Flutter IOS, ARCHIVE FAILED after upgraded Xcode to 13.0.0

Hi,

I’ve been deploying our Flutter application through CircleCi with Xcode 12.4.0. But, after upgrading Xcode to 13.0.0 (Not the beta version) in the config.yml file, the Fastlane build_app action doesn’t succeed anymore. It works fine locally.
I’ve been trying to solve the issue by taking the following actions but, nothing has worked.

  • I have selected the right version of Xcode as the Logs suggest.
  • I have updated Fastlane and all the Gems required for the deployment to run.
  • The application is up to date with the latest Flutter version and dependencies.
  • I tried THIS SOLUTION related to the Run Script from Build Phases in Xcode.
  • I tried THIS SOLUTION that seems to have solved similar problems when upgrading Xcode.

These are the logs with the maximum amount of details that I have obtained. I have checked the logs from Library/Logs/gym/ but no further details are included.

▸ Touching firebase_performance.framework (in target 'firebase_performance' from project 'Pods')
▸ Touching firebase_messaging.framework (in target 'firebase_messaging' from project 'Pods')
▸ Touching firebase_crashlytics.framework (in target 'firebase_crashlytics' from project 'Pods')
▸ Touching firebase_analytics.framework (in target 'firebase_analytics' from project 'Pods')
▸ Processing Pods-Runner-Info.plist
▸ Copying Pods-Runner-umbrella.h
▸ Compiling Pods-Runner-dummy.m
▸ Compiling Pods_Runner_vers.c
▸ Touching Pods_Runner.framework (in target 'Pods-Runner' from project 'Pods')
▸ Running script '[CP] Check Pods Manifest.lock'
▸ Running script 'Run Script'
** ARCHIVE FAILED **


The following build commands failed:
	PhaseScriptExecution Run\ Script /Users/distiller/Library/Developer/Xcode/DerivedData/Runner-gxqijsvgrrorpceyqfglwnknrvli/Build/Intermediates.noindex/ArchiveIntermediates/Development/IntermediateBuildFilesPath/Runner.build/Release-Development-iphoneos/Runner.build/Script-9740EEB61CF901F6004384FC.sh (in target 'Runner' from project 'Runner')
(1 failure)
[08:59:07]: Exit status: 65
[08:59:07]: 
[08:59:07]: Maybe the error shown is caused by using the wrong version of Xcode
[08:59:07]: Found multiple versions of Xcode in '/Applications/'
[08:59:07]: Make sure you selected the right version for your project
[08:59:07]: This build process was executed using '/Applications/Xcode-13.0.app'
[08:59:07]: If you want to update your Xcode path, either
[08:59:07]: 
[08:59:07]: - Specify the Xcode version in your Fastfile
[08:59:07]: ▸ xcversion(version: "8.1") # Selects Xcode 8.1.0
[08:59:07]: 
[08:59:07]: - Specify an absolute path to your Xcode installation in your Fastfile
[08:59:07]: ▸ xcode_select "/Applications/Xcode8.app"
[08:59:07]: 
[08:59:07]: - Manually update the path using
[08:59:07]: ▸ sudo xcode-select -s /Applications/Xcode.app
[08:59:07]: 

+---------------+------------------------------+
|              Build environment               |
+---------------+------------------------------+
| xcode_path    | /Applications/Xcode-13.0.app |
| gym_version   | 2.195.0                      |
| export_method | ad-hoc                       |
| sdk           | iPhoneOS15.0.sdk             |
+---------------+------------------------------+

[08:59:07]: ▸ Failed to package /Users/distiller/project.
[08:59:07]: ▸ Command PhaseScriptExecution failed with a nonzero exit code
[08:59:07]: ▸ /Users/distiller/project/ios/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 15.0.99. (in target 'FMDB' from project 'Pods')
[08:59:07]: 
[08:59:07]: ⬆️  Check out the few lines of raw `xcodebuild` output above for potential hints on how to solve this error
[08:59:07]: 📋  For the complete and more detailed error log, check the full log at:
[08:59:07]: 📋  /Users/distiller/Library/Logs/gym/Runner-Development.log
[08:59:07]: 
[08:59:07]: Looks like fastlane ran into a build/archive error with your project
[08:59:07]: It's hard to tell what's causing the error, so we wrote some guides on how
[08:59:07]: to troubleshoot build and signing issues: https://docs.fastlane.tools/codesigning/getting-started/
[08:59:07]: Before submitting an issue on GitHub, please follow the guide above and make
[08:59:07]: sure your project is set up correctly.
[08:59:07]: fastlane uses `xcodebuild` commands to generate your binary, you can see the
[08:59:07]: the full commands printed out in yellow in the above log.
[08:59:07]: Make sure to inspect the output above, as usually you'll find more error information there
[08:59:07]: 
+---------------------------+--------------------------------------------------------+
|                                    Lane Context                                    |
+---------------------------+--------------------------------------------------------+
| DEFAULT_PLATFORM          | ios                                                    |
| PLATFORM_NAME             | ios                                                    |
| LANE_NAME                 | ios publish_alpha                                      |
| KEYCHAIN_PATH             | ~/Library/Keychains/fastlane_tmp_keychain              |
| ORIGINAL_DEFAULT_KEYCHAIN | "/Users/distiller/Library/Keychains/login.keychain-db" |
+---------------------------+--------------------------------------------------------+
  • Does anyone have any idea about why this is happening? OR is this happening to anyone as well?:thinking:

same issue

Same issue with Xcode 13.1, but with react-native

I have solved this problem
set select xcode default + run “pod install” + pod update before archive ipa

Having the same issue. Did you ever resolve it?

which commands do you run exactly?

Same issue here, did you solved it? Which commands are you running?