I was trying to generate the ipa file to upload it on App Store but unfortunately it failed and says "Encountered error while archiving for device". I also tried Archiving from Xcode but, the Archive failed there too. It is working great in ios simulator (13)
Failed to build iOS app Error output from Xcode build: ↳ ** ARCHIVE FAILED **
Xcode's output: Writing result bundle at path:
/var/folders/8s/2st2j0d97k7cm80h3968jnx80000gn/T/flutter_tools.ph1v
kd/flutter_ios_build_temp_dirZbRdRw/temporary_xcresult_bundle
error: the following command failed with exit code 0 but produced no
further output
CompileC
Failed to package /Users/sunsoft/Downloads/alifpet-app-master.
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in dependency order
/Users/sunsoft/Downloads/alifpet-app-master/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.2.99. (in target 'Sodium' from project 'Pods')
/Users/sunsoft/Downloads/alifpet-app-master/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.2.99. (in target 'ReachabilitySwift' from project 'Pods')
/Users/sunsoft/Downloads/alifpet-app-master/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.2.99. (in target 'Starscream' from project 'Pods')
/Users/sunsoft/Downloads/alifpet-app-master/ios/Pods/Pods.xcodeproj:
warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
set to 6.0, but the range of supported deployment target versions is
9.0 to 15.2.99. (in target 'Reachability' from project 'Pods')
/Users/sunsoft/Downloads/alifpet-app-master/ios/Pods/Pods.xcodeproj:
warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is
set to 7.0, but the range of supported deployment target versions is
9.0 to 15.2.99. (in target 'AppAuth' from project 'Pods')
/Users/sunsoft/Downloads/alifpet-app-master/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.2.99. (in target 'PusherSwiftWithEncryption' from project
'Pods')
/Users/sunsoft/Downloads/alifpet-app-master/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.2.99. (in target 'GoogleSignIn' from project 'Pods')
/Users/sunsoft/Downloads/alifpet-app-master/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.2.99. (in target 'AgoraRtcEngine_iOS' from project 'Pods')
Result bundle written to path:
/var/folders/8s/2st2j0d97k7cm80h3968jnx80000gn/T/flutter_tools.ph1v
kd/flutter_ios_build_temp_dirZbRdRw/temporary_xcresult_bundle
Encountered error while archiving for device.
CodePudding user response:
The problem here is that the Podfile that Flutter template creates by default has no specific iOS version set unfortunately.
Do this to fix this problem:
- in
ios/
folder of your project, open thePodfile
. - At top of
Podfile
, make sure this line is not commented out and change the iOS version to 12.0.
change from:
#platform :ios, '8.0'
to:
platform :ios, '12.0'
Run
pod deintegrate
in Terminal inside theios/
folder of your project.Run
pod install --repo-update
in yourios/
folder
This should do the trick!
If after this you are getting the following error
CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target
Then you need to open your iOS workspace in Xcode and select your root project on top left, then inside the Info tab, choose your configuration (in this case Debug) and change it to None. After that, do pod install again.