Flutter command phasescriptexecution failed with a nonzero exit code

Command PhaseScriptExecution failed with a nonzero exit code (Flutter)

Questions : Command PhaseScriptExecution failed with a nonzero exit code (Flutter)

2022-09-18T18:16:17+00:00 2022-09-18T18:16:17+00:00

625

Everythign seems working in my app. I build anycodings_xcode the android app successfully, but while I am anycodings_xcode trtying to build usinx XCODE, I am getting:

Command PhaseScriptExecution failed with a anycodings_xcode nonzero exit code

I tried many ways, such as:

  • Flutter Clean
  • POD install
  • Legacy Build

Here is the error screenshot: anycodings_xcode https://i.postimg.cc/7PdNtwvN/Screen-Shot-2020-08-29-at-8-58-30-PM.png

I also followed guide provided here: anycodings_xcode https://github.com/flutter/flutter/issues/56507

Thanks and will be great help if anyone can anycodings_xcode assist.

Total Answers 1

27

Answers 1 : of Command PhaseScriptExecution failed with a nonzero exit code (Flutter)

in my case the reason no enough disk anycodings_flutter space on the mac

0

2022-09-18T18:16:17+00:00 2022-09-18T18:16:17+00:00Answer Link

mRahman

score:64

Accepted answer

This work for me Thanks Alexander Lozano, I upload image for Xcode Version 12.0.1

Flutter command phasescriptexecution failed with a nonzero exit code

score:-1

In my case i solved this issue by update xcode, so check the xcode if there is new update.

score:0

How I resolved this issue:

step 1: open up your flutter iOS directory in Xcode and try to build, it should give a more detailed overview of where the error is in your code.

PhaseScriptExecution failed with a nonzero exit code an error returned by Xcode build engine - you probably ignored warnings not obvious syntax error in your flutter code, could be a scope or imports declaration.

Ensure your build succeeds in Xcode before closing simulator.

score:0

Somewhat related to other questions, such as this. For me this started happening after some update in my Mac. The solution included a flutter clean + flutter pub get and restarting both the device (iPhone) and computer (Mac) - restarting the Mac made all the difference. Other answers may suggest to mark the "For install builds only" option on Xcode - that actually broke things for me, build started complaining about not finding Flutter.h. So yeah, restarting things may solve your problem. Perhaps throw in a flutter upgrade as well.

score:0

This worked out strange for me.

There recently was an new update, after which this issue appeared. After normal quitting and opening, error was visible.

Force quit the xcode and rebuilding the app worked for me.

score:0

Building it from the CLI fixed it for me

flutter build ipa

score:0

Anyone facing problem when building or archiving for 1st time on xcode

How I resolved this issue:

  1. clean flutter project with flutter clean
  2. build project with flutter build ios. This will sign app to the appstore
  3. build/archive app on xcode

score:1

Fix for me was force quitting Xcode. There recently was update, after which this issue appeared. After normal quitting and opening, there was error visible. But after force quitting and opening, Xcode showed dialog box, that some of its dependencies are missing and they will be downloaded. After that build was working for me again.

score:2

By doing flutter clean. Xcode builds clean.(Key: command+shift+k).

xcode ->targets->runner

in build phases: run script and thin binary, unselect: run script only when installing

then run flutter run in the terminal of the project resolve the issue for me.

score:3

This worked for me:
1) Add this to your podfile:

flutter_application_path = '/Users/dhavalkansara/FlutterToNative/AFE_flutter/'
    eval(File.read(File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')), binding)

    install_all_flutter_pods(flutter_application_path)

PS. You may also need to do that for each target, i.e

target 'AFEiOSTests' do
    inherit! :search_paths
    install_all_flutter_pods(flutter_application_path)
    # Pods for testing
  end

  target 'AFEiOSUITests' do
    inherit! :search_paths
    install_all_flutter_pods(flutter_application_path)
    # Pods for testing
  end

2) Run pod install

score:4

I was having the issue for 2 days.

My failure was slightly different:

Failed to package /path/to/my/app.
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Planning
note: Build preparation complete
note: Building targets in parallel

I was on Flutter 2.5.1, I tried all of the suggestions found here (amongst others I googled). I wish I knew the answer or understood why, but a simple

`flutter upgrade` 

Worked for me (I ended up with 2.5.3)

score:6

For beginners: (tested on XCODE 12.0.1) open Xcode--> Open a project or file --> go to the flutter app path/ios directory--> open --> Runner and follow attached image steps

Flutter command phasescriptexecution failed with a nonzero exit code

score:28

this works for me: xcode 11.3.1

xcode ->targets->runner

in build phases: run script and thin binary, select: run script only when installing


Related Query

  • Command PhaseScriptExecution failed with a nonzero exit code while trying to add Flutter to iOS app
  • Xcode 10.2.1 Command PhaseScriptExecution failed with a nonzero exit code
  • xcode Firebase Crashlytics Command PhaseScriptExecution failed with a nonzero exit code
  • Command PhaseScriptExecution failed with a nonzero exit code Xcode 11.3.1
  • Command PhaseScriptExecution failed with a nonzero exit code after adding firebase
  • Xcode 13.2 command PhaseScriptExecution failed with a nonzero exit code
  • Apollo iOS: Command /bin/sh failed with exit code 1 | Command PhaseScriptExecution failed with a nonzero exit code
  • iOS KMP Command PhaseScriptExecution failed with a nonzero exit code
  • flutter swift Command PhaseScriptExecution failed with a nonzero exit code
  • Command PhaseScriptExecution failed with a nonzero exit code Xcode 11 (BuildPhase Script)
  • Xcode11 Command PhaseScriptExecution failed with a nonzero exit code with SDWebImage
  • command phasescriptexecution failed with a nonzero exit code ios during archive
  • Xcode 12.0.1 Command PhaseScriptExecution failed with a nonzero exit code for ZendeskSDK
  • FBSDK and pod: Command PhaseScriptExecution failed with a nonzero exit code
  • Command PhaseScriptExecution failed with a nonzero exit code - using CocoaPods
  • how to solve this error Command PhaseScriptExecution failed with a nonzero exit code
  • Command PhaseScriptExecution failed with a nonzero exit code for R.swift
  • Xcode 11.3.1 - Command PhaseScriptExecution failed with a nonzero exit code
  • Xcode 12 update 'AFNetworking' Command PhaseScriptExecution failed with a nonzero exit code
  • Showing Recent Messages Command PhaseScriptExecution failed with a nonzero exit code xcode12
  • Command PhaseScriptExecution failed with a nonzero exit code iOS
  • Command PhaseScriptExecution failed with a nonzero exit code I
  • Command CompileSwift failed with a nonzero exit code in Xcode 10
  • Command CompileSwiftSources failed with a nonzero exit code XCode 13
  • Command CompileSwiftSources failed with a nonzero exit code Xcode 10
  • Error: Command CodeSign failed with a nonzero exit code after installing Xcode10 beta 5?
  • using bridging headers with module interfaces is unsupported Command CompileSwiftSources failed with a nonzero exit code
  • Getting clang: error: linker command failed with exit code 1 (use -v to see invocation) while google signing
  • Command MergeSwiftModule failed with a nonzero exit code
  • iOS: <unknown>:0: error: unknown argument: '-enable-batch-mode' Command CompileSwiftSources failed with a nonzero exit code

More Query from same tag

  • ContentMode changes in uiimageview after draw
  • Tweet not showing variable as string?
  • NSURLSession tasks run in for loop
  • iOS Swift stop duplicate HTTP requests
  • Whats the correct way, using "init" or "didmove"?
  • Swift ios - read key=value text file into nsdictionary
  • Swift3: HTTP POST request with parameters divided by "/"
  • Xcode Swift 3: Timer and Segue View Controller Error
  • UIImageView not segueing
  • Euler Angles Y value is affected by X and Z values - how do I zero them out to get a "truthful" y value?
  • Make iPhone vibrate on Local Notification
  • Swift and Sprite kit not touching properly
  • SwiftUI & Firestore
  • Wait for main queue being dispatched before continue unit test
  • Passing Image to another View Controller (Swift)
  • UIPickerView selection input Swift 4 or 5
  • Swift: Customizing TableView to hold multiple columns of data
  • SwiftUI: Forcing an Update
  • FIlter an array based an another array string item
  • iOS app: Rejected in AppStore to external testers
  • iOS - Container components in different storyboard
  • Does performing contains on a set make lazy map redundant?
  • make button in tableview section header float/align right programmatically // Swift
  • Trying to find users location in Xcode with Swift on starting the app but having optional error?
  • iOS strategy to keep buttons the same size between viewcontrollers
  • How to send selected row (JSON) in TableView to another View Controller?
  • If a user initially denied Siri support for your app, how can they later enable it?
  • Log out of accounts / Clear navigation when WebView is resigned
  • How can I enable ABI stability for a SwiftPM package?
  • SwiftUI combine search text