在 Xcode 11 中为 iOS 构建失败

时间:2021-04-30 09:34:30

标签: ios xcode flutter

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

error

这是我的颤振 --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"])

我需要你的帮助来找出这个错误的来源。

1 个答案:

答案 0 :(得分:2)

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

<块引用>

Xcode 11.4.1 已过期(建议使用 12.0.1)。

虽然需要 Xcode 12 才能构建并上传到 App Store。更新 Xcode 并再次尝试构建。