Flutter:iOS 构建失败

Posted

技术标签:

【中文标题】Flutter:iOS 构建失败【英文标题】:Flutter: iOS build fails 【发布时间】:2020-08-17 08:56:48 【问题描述】:

我对 Flutter 有疑问。我无法在 ios 模拟器上运行我的应用程序。我试图在 Mac 钥匙串下创建一个新证书,但这对我没有多大帮助。有谁知道我该如何解决这个问题?

(base) seroaslan@Seros-MBP Desktop % flutter doctor   
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.9, on Mac OS X 10.15.4 19E287, locale da-DK)
[✓] android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
[✓] Android Studio (version 3.5)
[!] IntelliJ IDEA Ultimate Edition (version 2020.1.1)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.44.2)
[✓] Connected device (1 available)

! Doctor found issues in 1 category.

(base) seroaslan@Seros-MBP tutorial % flutter run             

Launching lib/main.dart on iPhone 8 in debug mode...
Running Xcode build...                                                  

 ├─Assembling Flutter resources...                           2,8s
 └─Compiling, linking and signing...                         3,0s
Xcode build done.                                            9,2s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    /Users/seroaslan/Desktop/tutorial/build/ios/Debug-iphonesimulator/Runner.app: resource fork, Finder
    information, or similar detritus not allowed
    Command CodeSign failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description

Could not build the application for the simulator.
Error launching application on iPhone 8.

【问题讨论】:

运行颤振医生并将其添加到您的问题中,并尝试连接到其他设备。 嘿。它确实适用于 Android 设备/模拟器。就像你问的那样,我已经从终端粘贴了颤振医生。我用了4个小时解决了这个问题,不知道怎么解决。 我已经发布了一个应该解决这个问题的答案。只需确保在重新设置时仔细阅读每个步骤,以免遗漏任何步骤。 【参考方案1】:

答案就在你的颤振医生身上:

✗ Flutter 插件未安装;这增加了 Flutter 特定的功能。 ✗ Dart 插件未安装;这增加了 Dart 特定的功能。

您需要通过重新设置来解决这些问题,如下所示:https://flutter.io/setup-macos/

【讨论】:

以上是关于Flutter:iOS 构建失败的主要内容,如果未能解决你的问题,请参考以下文章

Flutter - iOS 构建失败

当我运行 flutter run 时,Flutter iOS 构建失败

Flutter ios 构建失败 - Distill 因未知原因而失败

iOS 的 Flutter 构建失败

为啥 Flutter iOS 构建失败?

由于线程构建失败,Flutter 在 iOS 上崩溃