简体   繁体   English

Flutter:无法构建 iOS 应用程序“ARCHIVE FAILED”,为设备归档时遇到错误

[英]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:这样做可以解决这个问题:

  1. in ios/ folder of your project, open the Podfile .在项目的ios/文件夹中,打开Podfile
  2. At top of 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'
  1. Run pod deintegrate in Terminal inside the ios/ folder of your project.在项目的ios/文件夹内的终端中运行pod deintegrate

  2. 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.

相关问题 Flutter build ios 错误:为设备构建时遇到错误 - Flutter build ios error: Encountered error while building for device Flutter 错误“无法构建 iOS 应用程序(...)” - Flutter Error "Failed to build iOS App (...)" Flutter 无法仅在物理 iOs 设备中构建和运行 iOS 应用程序 - Flutter Failed to build and run iOS app only in physical iOs device 针对 iOS 的 Corodva 应用程序构建失败 ** 存档失败 ** - Corodva app build fails for iOS ** ARCHIVE FAILED ** iOS平台的Ionic 3构建错误 - ARCHIVE FAILED - Ionic 3 build error for iOS platform - ARCHIVE FAILED 无法构建 iOS 应用错误 output 来自 Xcode 构建,对于 flutter - Failed to build iOS app Error output from Xcode build , for flutter 归档IOS应用程序时无法导入桥接头 - Failed to import bridging header while archiving an IOS app 从连接的 iOS 设备检索日志文件时,如何解决“无法创建存档:设备未配置 (6)”错误? - How to resolve 'failed to create archive: Device not configured (6)' error while retrieving log files from a connected iOS Device? Flutter 构建 iOS 错误:在 iOS 设备中构建 Flutter 应用程序时遇到错误 - Flutter build iOS error : Encountering error while build flutter app in iOS device Flutter - 无法在 Android Studio 上构建 iOS 应用程序 - Flutter - Failed to build iOS app on Android Studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM