gpt4 book ai didi

ios - 如何修复命令 PhaseScriptExecution 失败并在 macOS 中运行 Flutter 时出现非零退出代码?

转载 作者:行者123 更新时间:2023-12-04 09:11:47 26 4
gpt4 key购买 nike

我正在开发一个 flutter 应用程序。我最近转移到 macOS,从那时起就无法运行该应用程序。其他应用程序运行良好,所以我认为错误在这个应用程序的代码中。也许由于同样的原因,我无法进行构建。
这是 flutter doctor 的输出:

[✓] Flutter (Channel stable, 1.20.1, on Mac OS X 10.15.6 19G73, locale en-US)
• Flutter version 1.20.1 at /Users/bhawna/dev/flutter
• Framework revision 2ae34518b8 (4 days ago), 2020-08-05 19:53:19 -0700
• Engine revision c8e3b94853
• Dart version 2.9.0

[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, set ANDROID_SDK_ROOT to that location.
You may also want to add it to your PATH environment variable.



[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.6, Build version 11E708
• CocoaPods version 1.9.3

[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).

[✓] VS Code (version 1.47.3)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.13.2


[✓] Connected device (1 available)
• iPhone 8 (mobile) • 3D03BDE4-F1A6-45AB-B095-01107CDDC2CD • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-6 (simulator)
flutter run 的输出:
Running "flutter pub get" in delivero...                            1.6s
Launching lib/main.dart on iPhone 8 in debug mode...

Running pod install... 38.2s
Running Xcode build...

Xcode build done. 449.0s
Failed to build iOS app
Error output from Xcode build:

** BUILD FAILED **


Xcode's output:

/Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inapp_purchase-2.2.0/ios/Classes/FlutterInappPurchasePlugin.
m:45:52: warning: assigning to 'id<IAPPromotionObserverDelegate>' from incompatible type 'FlutterInappPurchasePlugin *__strong'
[IAPPromotionObserver sharedObserver].delegate = self;
^ ~~~~
/Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inapp_purchase-2.2.0/ios/Classes/FlutterInappPurchasePlugin.
m:200:79: warning: implicit conversion loses integer precision: 'SKPaymentTransactionState' (aka 'enum
SKPaymentTransactionState') to 'int' [-Wshorten-64-to-32]
[NSNumber numberWithInt: item.transactionState], @"transactionStateIOS",
~ ^~~~~~~~~~~~~~~~~~~~~
/Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_inapp_purchase-2.2.0/ios/Classes/FlutterInappPurchasePlugin.
m:586:71: warning: implicit conversion loses integer precision: 'SKPaymentTransactionState' (aka 'enum
SKPaymentTransactionState') to 'int' [-Wshorten-64-to-32]
[NSNumber numberWithInt: transaction.transactionState], @"transactionStateIOS",
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings generated.
/Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/contacts_service-0.3.10/ios/Classes/ContactsServicePlugin.m:6:4:
warning: 'SwiftContactsServicePlugin' is only available on iOS 9.0 or newer [-Wunguarded-availability]
[SwiftContactsServicePlugin registerWithRegistrar:registrar];
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from
/Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/contacts_service-0.3.10/ios/Classes/ContactsServicePlugin.m:2:
/Users/bhawna/delivero/delivero/build/ios/Debug-iphonesimulator/contacts_service/contacts_service.framework/Headers/contacts_serv
ice-Swift.h:213:12: note: 'SwiftContactsServicePlugin' has been marked as being introduced in iOS 9.0 here, but the deployment
target is iOS 8.0.0
@interface SwiftContactsServicePlugin : NSObject <FlutterPlugin>
^
/Users/bhawna/dev/flutter/.pub-cache/hosted/pub.dartlang.org/contacts_service-0.3.10/ios/Classes/ContactsServicePlugin.m:6:4:
note: enclose 'SwiftContactsServicePlugin' in an @available check to silence this warning
[SwiftContactsServicePlugin registerWithRegistrar:registrar];
^~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
/Users/bhawna/dev/flutter/packages/flutter_tools/bin/xcode_backend.sh: line 13: pushd: /Users/hrvoje/Documents/Delivero
Files/contactsFeature: No such file or directory
Command PhaseScriptExecution 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.
任何帮助都会很棒。谢谢你的时间。

最佳答案

经过 2 天的努力,使我的存档成功的简单命令:

flutter clean
flutter pub get
flutter pub upgrade
cd iOS
pod install
pod update
问题就解决了。

关于ios - 如何修复命令 PhaseScriptExecution 失败并在 macOS 中运行 Flutter 时出现非零退出代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63336927/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com