ios - Xcode 11 中的 iOS 构建失败

标签 ios xcode flutter

我将 iOS SDK 从 13.4 更改为 14.0,然后尝试为 ios 构建,但当我尝试使用 13.4 构建时失败。它没有显示错误,但我无法上传应用程序,它在图片上显示错误,因此需要升级我的 SDK。

error

这是我的 flutter --verbose:

    [✓] Flutter (Channel stable, 2.0.5, on Mac OS X 10.15.3 19D76 darwin-x64, locale en-US)
    • Flutter version 2.0.5 at /Users/fee/Documents/Developer/flutter
    • Framework revision adc687823a (2 weeks ago), 2021-04-16 09:40:20 -0700
    • Engine revision b09f014e96
    • Dart version 2.12.3

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/fee/Library/Android/sdk
    • Platform android-30, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[!] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.4.1, Build version 11E503a
    ! Xcode 11.4.1 out of date (12.0.1 is recommended).
      Download the latest version or update via the Mac App Store.
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 44.0.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] Connected device (2 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86    • Android 10 (API 29) (emulator)
    • Chrome (web)                       • chrome        • web-javascript • Google Chrome 90.0.4430.93

并且,这是显示的错误

Xcode 构建的错误输出:

2021-04-30 13:05:34.432 XCBBuildService[28375:199855] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk: error: SDK 'iphoneos14.0'
    already registered from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
    2021-04-30 13:05:34.610 XCBBuildService[28375:199855] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk: error: SDK 'iphoneos14.0'
    already registered from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
    2021-04-30 13:05:34.840 XCBBuildService[28375:199855] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk: error: SDK 'iphoneos14.0'
    already registered from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
    ** BUILD FAILED ** 

Xcode's output:
↳
    note: Using new build system
    note: Building targets in parallel
    error: unknown error while handling message: unableToInitializeCore(errors: ["/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.0.sdk:
    error: SDK \'iphoneos14.0\' already registered from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk"])

我希望您帮助找出此错误的来源。

最佳答案

您的flutter doctor基本上为您提到了这个问题:

Xcode 11.4.1 out of date (12.0.1 is recommended).

而需要 Xcode 12 来构建并上传到 App Store。更新 Xcode 并尝试再次构建。

关于ios - Xcode 11 中的 iOS 构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67331528/

相关文章:

ios - 从 iOS 打印的分步教程?

flutter - 未处理的异常 : type 'Future<void>' is not a subtype of type 'Future<Photography>' on Firestore

flutter - 使用 AuthController 传递用户 ID

flutter - 尝试运行应用程序 flutter 时未找到 AppLocalization 类

ios - 将标签栏移动到屏幕顶部

ios - 如何使用 ObjectId 数组从 Parse 中检索用户数组?

ios - 尝试在 Moya 中发送 [JSON] 作为参数值时出现错误

swift - 当我尝试在 Xcode 中导入 VisualRecognitionV3 时,它给出了用 swift 3.0 编译的错误模块无法在 swift 3.0.2 中导入?

ios - 应用程序在iOS 10及更早版本上使用 “Could not instantiate class named _UIScrollViewLayoutGuide”崩溃

ios - 如何将构建版本上传到 iTunes Connect for TestFlight?