我试图生成IPA文件以将其上传到App Store,但不幸的是它失败了,并显示"为设备存档时遇到错误". 我也try 过从Xcode存档,但是存档在那里也失败了.它在iOS模拟器中运行良好(13)

构建iOS应用失败 Xcode内部版本的错误输出: ↳ **归档失败**

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.

推荐答案

不幸的是,这里的问题是Flutter 模板默认创建的Podfile没有设置特定的IOS版本.

执行此操作以解决此问题:

  1. 在项目的ios/文件夹中,打开Podfile.
  2. Podfile的顶部,确保这一行被注释掉,并将iOS版本更改为12.0.

更改自:

#platform :ios, '8.0'

致:

platform :ios, '12.0'
  1. 在项目的ios/文件夹内的终端中运行pod deintegrate.

  2. ios/文件夹中运行pod install --repo-update

这个应该行得通!

如果在此之后您收到以下错误

CocoaPods没有设置项目的基本配置,因为您的项目已经设置了自定义配置.要使CocoaPods集成正常工作,请设置目标的基本配置

然后,您需要在Xcode中打开您的iOS工作区,并 Select 左上角的根项目,然后在Info选项卡中, Select 您的配置(在本例中为Debug),并将其更改为None.之后,再次进行Pod安装.

enter image description here

Ios相关问答推荐

SwiftUI文本编辑器内部滚动填充,无需文本裁剪

在SwiftUI中使用系统图像和色调创建圆形按钮

阿拉伯文变音符号(Harakat)在文本对齐的UILabel中未对齐

自定义UIControl不适用于UITapGestureRecognizer

发生错误.请稍后重试.在 App Store 连接中

如何创建装饰视图?

如何通过点击按钮滚动到 ScrollView 中的特定视图?

在 iOS 上启用明文本地流量在 .NET MAUI 中不起作用

滚动 swiftUI 列表时,未调用单元格的任务修饰符.怎么修?

在 Swift 中执行 while 循环

关闭所有打开的视图控制器的单个函数

在原生和 phonegap 之间挣扎,简单的应用需求

如何找出用于构建 *.ipa 文件的配置文件?

核心数据 - 无法在路径加载优化模型

Swift 将 unix 时间转换为日期和时间

Select 器touchesBegan:withEvent:的覆盖方法具有不兼容的类型(NSSet,UIEvent)->()

iOS SDK - 以编程方式生成 PDF 文件

什么是强属性属性

在 iOS 7 中更改返回按钮会禁用滑动导航返回

Xcode 5 和 iOS 7:架构和有效架构