Xcode 11 Command PhaseScriptExecution failed with a nonzero exit code

Running Mojave 10.14.6

Xcode 11.0 (11A420a)

iOS 13.1.2

iPhone 6s Plus


I cannot seem to find the solution here or on Stack Overflow.


When compiling, I keep getting this error:


Command PhaseScriptExecution failed with a nonzero exit code


I tried in Xcode


Xcode > Preferences > Accounts

signing in and out


I have created a new Dev Cert, Distribution Cert, new PUSH certs, new provisional profiles


I have tried pod updates


I have tried changing the Build Phase info with chmod +x

as recommended by this post

https://forums.developer.apple.com/thread/122796?start=0&tstart=0


I have tried rebooting my phone. I have tried rebooting the computer. rebooting xcode (obviously)


Don't know what else to do.

Post not yet marked as solved Up vote post of sharpwitz Down vote post of sharpwitz
221k views
  • Try this simple trick.. : https://not.justsolutionsproducts.com/xcode-11-command-phasescriptexecution-failed-with-a-nonzero-exit-code/

  • Too many ads on this links.... :(

  • Bogus link from Alquopi6, DO NOT CLICK ON IT

Replies

Here in 9/2023, this was simply a Cocoa pods bug for Archiving.

sudo gem update cocoapods

then do all the things.

The Error: "PhaseScriptExecution failed with a nonzero exit code" is a symptom not a root-cause. Trying blind fixes like multiple clean and Xcode project file manipulation will not necessarily fix your problem. As long as you do not really know what the problem actually is. In order to find the problem, in Xcode go to Report Navigator tab from left (last icon in Xcode 15) and select the Build that resulted in error. There you'll be able to see more about the actual error that is causing the PhaseScriptException. In my case I was getting this error on a Kotlin Multi Platform project and it was cause due to java incompatibility version between os and Gradle.

  • Thanks for teaching how to work with errors. In my case python was missing. Installing python solved the problem.

Add a Comment

Nonthing from above didn't help me, but mac/iPhone restart helped

Seems like a lot of things can trigger this error. I just solved it for me (I'm using a free developer account) by Looking at XCODE->Settings->Accounts->Manage Certificates, and I saw a revoked certificate in the list. I deleted that, and my build succeeded.

for me, this issue is caused by my mac disk is full. This information was got by looking into the detail of build log, after navigating to the "Report navigator" in Xcode. there is much more concrete info what failed exactly

still facing the issue, mac m1 OS Sonoma, nothing else instead of "Command PhaseScriptExecution failed with a nonzero exit code" i do not have in logs.

Had a sane problem, turned out I had a syntax error in one of my tsx files.

jeffersonsb answer worked for me