Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncategorized (Xcode): Command CodeSign failed with a nonzero exit code [closed]

Image of the Error help me out here As soon as Updated to the latest Xcode 15, I started getting this error.

I also Updated my mac to sonoma os .I have been stuck on this error for 3 days now and tried everything.

Flutter Code was working fine over Xcode 14.

Pod update pod install pod degenerated and installed again The IOS folder was deleted and then made again using Flutter Create.

Noting Works Help me here.

like image 446
Abhishek DANGI Avatar asked Sep 07 '26 19:09

Abhishek DANGI


1 Answers

Try adding this in your podfile:

xcode_base_version = `xcodebuild -version | grep 'Xcode' | awk '{print $2}' | cut -d . -f 1`

  post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
        # For xcode 15+ only
         if config.base_configuration_reference && Integer(xcode_base_version) >= 15
          xcconfig_path = config.base_configuration_reference.real_path
          xcconfig = File.read(xcconfig_path)
          xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
           File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
        end
      end
    end
  end

If you already have a post_install do |installer|, add only the if condition along with the end.

like image 196
The Pedestrian Avatar answered Sep 10 '26 10:09

The Pedestrian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!