Reputation: 31
i not have an mac for develop with flutter so i use codemagic. while i build the app i get an error. I search many time but not find the reason. I dont know what mean "ARCHIVE FAILED" Can anyone help me.
note: Build preparation complete
/Users/builder/clone/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 14.5.99. (in target 'OrderedSet' from project 'Pods')
/Users/builder/clone/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 14.5.99. (in target 'Flutter' from project 'Pods')
Failed to build iOS app Error output from Xcode build: ↳ ** ARCHIVE FAILED **
Xcode's output: ↳ ld: bitcode bundle could not be generated because '/Users/builder/programs/flutter_2_2_1/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-armv7_arm64/Flutter.framework/Flutter' was built without full bitcode. All frameworks and dylibs for bitcode must be generated from Xcode Archive or Install build file '/Users/builder/programs/flutter_2_2_1/bin/cache/artifacts/engine/ios/Flutter.xcframework/ios-armv7_arm64/Flutter.framework/Flutter' clang: error: linker command failed with exit code 1 (use -v to see invocation) note: Using new build system note: Building targets in parallel note: Planning build note: Analyzing workspace note: Constructing build description note: Build preparation complete /Users/builder/clone/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 14.5.99. (in target 'OrderedSet' from project 'Pods') /Users/builder/clone/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 14.5.99. (in target 'Flutter' from project 'Pods')
Upvotes: 2
Views: 485
Reputation: 635
As the error message states, the problem is that there are multiple deployment targets set in your project that contradict. Most likely: your app declares to support iOS 8 and up (I think that's still what ships with the blank/example Flutter apps as well) but some of the plugins that you use only support iOS 9.
Solution:
Decide what version you need/want to support. At the time of writing this, iOS 14 is out and 15 is announced. Apple officially recommends developers to support the latest two versions. However, in practice what you'll likely need is to support the last 3-4 versions. So iOS 9+ is definitely enough but might even go with 11+.
In your PodFile
(located in your app's /ios
folder):
Find platform :ios, '8.0'
and set the number according to your needs.
project.pbxproj
file in the /ios/Runner.xcodeprojec
folder:Find all IPHONEOS_DEPLOYMENT_TARGET = 8.0;
lines and set the number here as well.
post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) target.build_configurations.each do |config| config.build_settings['ENABLE_BITCODE'] = 'NO' config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0' end end end
This will ensure that all your targets are set properly (instead of step 3). Plus, it will disable bitcode generation which could be an issue with Codemagic as mentioned in this post.
Upvotes: 0