首页 > 解决方案 > 从 Android Studio 构建 Flutter 项目时它失败了,但不是从 Xcode(在 Flutter 升级之后)

问题描述

我最近升级了 Flutter 框架,当我尝试从 Android Studio 构建和运行项目时,我收到以下警告和错误:

Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Running Xcode build...
Xcode build done.                                            2.2s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    <built-in>:1:10: warning: non-portable path to file '"/Users/<something ...>/ios/Pods/Target Support Files/AppCenter/appcenter-prefix.pch"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
    #include "/Users/<something ...>/ios/Pods/Target Support Files/appcenter/appcenter-prefix.pch"
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
             "/Users/<something ...>/ios/Pods/Target Support Files/AppCenter/appcenter-prefix.pch"
    1 warning generated.
    1 warning and 1 error generated.
    error: the following command failed with exit code 0 but produced no further output
    CompileC /Users/stefanciprian/Library/Developer/Xcode/DerivedData/Runner-gsbrrhndnahwimaidnqhpsuayzxa/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/appcenter_analytics.build/Objects-normal/x86_64/AppcenterAnalyticsPlugin.o /Users/stefanciprian/Desktop/flutter/.pub-cache/hosted/pub.dartlang.org/appcenter_analytics-0.2.1/ios/Classes/AppcenterAnalyticsPlugin.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    note: Using new build system
    note: Planning build
    note: Constructing build description

Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.

如果我在 Xcode 中打开项目,我会收到相同的警告,但不知何故,我设法在模拟器上成功构建和运行。

我尝试了 GitHub 问题中有关路径和符号链接的一些建议,但它们似乎不起作用。

还添加了颤振医生信息:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.15.2 19C57, locale en-RO)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3)
[✓] Android Studio (version 3.5)
[✓] IntelliJ IDEA Ultimate Edition (version 2019.3.1)
[✓] VS Code (version 1.41.1)
[✓] Connected device (1 available)

• No issues found!

标签: iosxcodeandroid-studioflutterbuild

解决方案


推荐阅读