[英]Flutter : Failed to build iOS app "ARCHIVE FAILED",Encountered error while archiving for device
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".我试图生成 ipa 文件以将其上传到 App Store,但不幸的是它失败并显示“为设备归档时遇到错误”。 I also tried Archiving from Xcode but, the Archive failed there too.
我也尝试过从 Xcode 存档,但是存档也失败了。 It is working great in ios simulator (13)
它在 ios 模拟器中运行良好 (13)
Failed to build iOS app Error output from Xcode build: ↳ ** ARCHIVE FAILED **无法构建 iOS 应用 Xcode 构建的错误输出:↳ ** ARCHIVE FAILED **
Xcode's output: Writing result bundle at path: Xcode 的输出:在路径中写入结果包:
/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.
The problem here is that the Podfile that Flutter template creates by default has no specific iOS version set unfortunately.这里的问题是 Flutter 模板默认创建的 Podfile 没有设置特定的 iOS 版本。
Do this to fix this problem:这样做可以解决这个问题:
ios/
folder of your project, open the Podfile
.ios/
文件夹中,打开Podfile
。Podfile
, make sure this line is not commented out and change the iOS version to 12.0.Podfile
顶部,确保没有注释掉这一行并将 iOS 版本更改为 12.0。 change from:更改自:
#platform :ios, '8.0'
to:至:
platform :ios, '12.0'
Run pod deintegrate
in Terminal inside the ios/
folder of your project.在项目的
ios/
文件夹内的终端中运行pod deintegrate
。
Run pod install --repo-update
in your ios/
folder在您的
ios/
文件夹中运行pod install --repo-update
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.
CocoaPods 没有设置您项目的基本配置,因为您的项目已经有一个自定义配置集。 In order for CocoaPods integration to work at all, please either set the base configurations of the target
为了使 CocoaPods 集成能够正常工作,请设置目标的基本配置
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.然后您需要在 Xcode 中打开您的 iOS 工作区并选择左上角的根项目,然后在 Info 选项卡中,选择您的配置(在本例中为 Debug)并将其更改为 None。 After that, do pod install again.
之后,再次执行 pod install。
I am getting this error while building with command flutter build ipa --release --no-tree-shake-icons while it is working fine when i archive with xcode.我在使用命令 flutter build ipa --release --no-tree-shake-icons 构建时遇到此错误,而当我使用 xcode 存档时它工作正常。
Result bundle written to path:
/var/folders/ds/bbptl8p5391_lg2drzvrgt3w0000gn/T/flutter_tools.VLOTC5/flutter_ios_build_temp_d
ir8SL9Nl/temporary_xcresult_bundle
Uncategorized (Xcode): Exited with status code 1未分类(Xcode):以状态码 1 退出
Encountered error while archiving for device.为设备归档时遇到错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.