flutter run error Command PhaseScriptExecution failed with a nonzero exit code but works with Xcode

Viewed 125

whenever I'm trying to run flutter using VScode I get this error

** BUILD FAILED ** Xcode's output: ↳ Command PhaseScriptExecution failed with a nonzero exit code note: Using new build system note: Building targets in parallel note: Planning build note: Analyzing workspace note: Constructing build description note: Build preparation complete Could not build the application for the simulator. Error launching application on iPhone 12.

but it builds and runs with Xcode successfully.

my flutter doctor

[✓] Flutter (Channel stable, 2.2.3, on macOS 11.4 20F71 darwin-x64, locale en-SA) • Flutter version 2.2.3 at /Users/MJ/Development/Tools/flutter • Framework revision f4abaa0735 (8 days ago), 2021-07-01 12:46:11 -0700 • Engine revision 241c87ad80 • Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1) • Android SDK at /Users/MJ/Library/Android/sdk • Platform android-30, build-tools 30.0.1 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 12.5.1, Build version 12E507 • CocoaPods version 1.10.1

[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.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.8+10-b944.6916264)

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

[✓] Connected device (4 available) • MJs iPhone (mobile) • 00008101-0016114C3E10001E • ios • iOS 14.6 • iPhone 12 (mobile) • E504D08A-A8D9-443E-AD19-D91C0EBFD823 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator) • macOS (desktop) • macos • darwin-x64 • macOS 11.4 20F71 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 91.0.4472.114

• No issues found!

I have tried deleting podfile and podfile.lock, tried flutter clean and flutter build iOS and flutter run all giving me the same error. but when I'm running or building with Xcode it builds fine with no errors.

please help it's been three weeks now reading the whole internet with now luck.

0 Answers
Related