我在这个问题上浪费了差不多一个星期,但毫无结果。
这是错误:
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
Writing result bundle at path:
/var/folders/fq/7j2x58m57c9bk10jg7q47krr0000gn/T/flutter_tools.vyKPSp/flutter_ios_build_temp_di
rGZCufm/temporary_xcresult_bundle
Failed to package /Volumes/ME/Projects/Flutter-Proj/app.
Command PhaseScriptExecution failed with a nonzero exit code
note: Building targets in dependency order
warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every
build because it does not specify any outputs. To address this warning, either add output
dependencies to the script phase, or configure it to run in every build by unchecking "Based on
dependency analysis" in the script phase. (in target 'BoringSSL-GRPC' from project 'Pods')
warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every
build because it does not specify any outputs. To address this warning, either add output
dependencies to the script phase, or configure it to run in every build by unchecking "Based on
dependency analysis" in the script phase. (in target 'abseil' from project 'Pods')
warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every
build because it does not specify any outputs. To address this warning, either add output
dependencies to the script phase, or configure it to run in every build by unchecking "Based on
dependency analysis" in the script phase. (in target 'Libuv-gRPC' from project 'Pods')
warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every
build because it does not specify any outputs. To address this warning, either add output
dependencies to the script phase, or configure it to run in every build by unchecking "Based on
dependency analysis" in the script phase. (in target 'gRPC-Core' from project 'Pods')
warning: Run script build phase 'Create Symlinks to Header Folders' will be run during every
build because it does not specify any outputs. To address this warning, either add output
dependencies to the script phase, or configure it to run in every build by unchecking "Based on
dependency analysis" in the script phase. (in target 'gRPC-C++' from project 'Pods')
warning: Run script build phase 'Run Script' will be run during every build because it does not
specify any outputs. To address this warning, either add output dependencies to the script
phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the
script phase. (in target 'Runner' from project 'Runner')
note: Run script build phase 'Thin Binary' will be run during every build because the option to
run the script phase "Based on dependency analysis" is unchecked. (in target 'Runner' from
project 'Runner')
warning: Run script build phase '[firebase_crashlytics] Crashlytics Upload Symbols' will be run
during every build because it does not specify any outputs. To address this warning, either add
output dependencies to the script phase, or configure it to run in every build by unchecking
"Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
Result bundle written to path:
/var/folders/fq/7j2x58m57c9bk10jg7q47krr0000gn/T/flutter_tools.vyKPSp/flutter_ios_build_temp_di
rGZCufm/temporary_xcresult_bundle
Could not build the precompiled application for the device.
Error launching application on iPhone.
这些都是我曾经尝试过的事情:
- 清新的Flutter和豆荚
rm Podfile.lock
flutter clean
flutter pub get
pod repo update
pod install
- 清除pod缓存并重新执行上述操作。
- 已重新安装Xcode、Flutter和Android Studio。
- 选中/取消选中
For install builds only
和/或Based on dependency analysis
。 - 随之而来的是许多种解决办法:[这里](How to fix Command PhaseScriptExecution failed with a nonzero exit code on flutter run in macOS?)、[这里](Command PhaseScriptExecution failed with a nonzero exit code while trying to add Flutter to iOS app)和[这里](Flutter Failed to package. Command PhaseScriptExecution failed with a nonzero exit code)。还有更多类似的。
- 使用
pngcheck
检查所有PNG文件是否有错误
以上都不起作用。
我的flutter doctor -v
[✓] Flutter (Channel stable, 3.3.4, on macOS 12.6 21G115 darwin-x64, locale en-US)
• Flutter version 3.3.4 on channel stable at /Users/ME/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision eb6d86ee27 (5 days ago), 2022-10-04 22:31:45 -0700
• Engine revision c08d7d5efc
• Dart version 2.18.2
• DevTools version 2.15.0
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
• Android SDK at /Volumes/ME/Applications/Android/sdk
• Platform android-32, build-tools 32.0.0
• ANDROID_HOME = /Volumes/ME/Applications/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14A400
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
[✓] VS Code (version 1.71.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.48.0
[✓] Connected device (3 available)
• iPho (mobile) • 00012101-001965606543001E • ios • iOS 15.6.1 19G82
• macOS (desktop) • macos • darwin-x64 • macOS 12.6 21G115
darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome
105.0.5195.125
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
3条答案
按热度按时间wribegjk1#
请按照以下步骤操作
1.转到iOS文件夹并删除podfile。lock,pods,xcworkspace
1.转到根文件夹并使用flutter clean
1.一种扑击棒
1.转到iOS文件夹并安装用户pod
N:B:记住删除xcworkspace文件,否则它将不工作,并检查您的pod是否更新。如果您的pod没有更新,则使用pod repo更新。
gg58donl2#
请尝试以下步骤。
1.转到根文件夹并运行命令“flutter clean”
1.运行命令“dart pub get”
1.运行命令“pub getflutter”
1.转到iOS文件夹并运行命令“pod install”
1.转到根文件夹并运行命令“flutter run --no-sound-null-safety”
dsekswqp3#
嗨,我有这个错误,经过几个星期的多次失败的尝试。
我找到了一个解决方案,对我很有效
在项目执行者下|组态
将配置集从Pods-Runner.debug更改为Debug。
更改后,应用程序将构建。
真的希望这对你有用,因为我知道这对我来说是多么的令人沮丧。