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
216k 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

Can you tell more about Command PhaseScriptExecution ?


Is it your own code ?


Or an external lib ? If so, it may be an incompatible version. Did you check ?

It seems like you have a Build Run Script in your Build Phases that is failing. You might want to look at the build logs to see what is happening.

  • I fixed this error message by a simple execution of XCode> Product> Clean Build Folder I don't know how or why the error even incurred, or what the nature of the problem is, though I upgraded from a beta to an RC so stuff like this isn't unexpected

Add a Comment

I usually have this problem when a dependency is not updated.

You can try following these steps, this usually works for me:

1- Delete your Podfile.lock (I like to use the command '-rm -rf Podfile.lock' on the terminal for this)

2- Delete your Pods folder (I like to use the command '-rm -rf Pods' in the terminal for this)

3- Delete your .xcworkspace

4- Pod install

5- Clear your project into XCode> Product> Clean Build Folder

  • This worked for me. Thank you.

  • This did not work for me.

  • This worked for me

How to fix this?

  • I got this problem after changing the directory name of a flutter app, to fix this problem I just '-rm -rf Podfile.lock' '-rm -rf Pods'

    and instead of deleting the .xcworkspace file, I checked the file into it I updated the directory name path into the file Runner/flutter/generated

    and everything started working again

Add a Comment

This totally worked for me!

Xcode 13.3 beta

ios 13.2

Add a Comment

I also facing the same issue but I am trying to follow the way, my error is fixed once try this.

Go to Keychain Access in your MAC


Keychain Access
->
Right-click on login
->
Lock & unlock again
->
Clean Xcode project
->
Make build again
  • I don't have the option to Lock, it's greyed out - any idea why?

  • Same issue , lock option is in gray color.

  • This Worked!!!

Add a Comment

it works!

This worked for me as well. Xcode 11.4.1

I solved this problem by renaming my folder back in English. (I rename it into English + Japanese, and the next day came this error)

Following does not work in xcode

I usually have this problem when a dependency is not updated.

You can try following these steps, this usually works for me:
1- Delete your Podfile.lock (I like to use the command '-rm -rf Podfile.lock' on the terminal for this)
2- Delete your Pods folder (I like to use the command '-rm -rf Pods' in the terminal for this)
3- Delete your .xcworkspace
4- Pod install
5- Clear your project into XCode> Product> Clean Build Folder

Please suggest solution
  • This did not work for me. I think my issue is because I am using the "n" library and a react-native script doesn't recognize my npm. The simlink solution did work for me.

Add a Comment
nothing worked for me, until go to VSCode(IDE APP), and ios/App/App.xcodeproj/project.pbxproj that file , and searched
EXCLUDED_ARCHS = arm64; and delete that line,

i did same thing from xcode, like go to target>build settings, exclude arc thing and deleted arm64 from there, didnt worked before, but deleting from VSCode worked , weird
  • Wow 😮 What an answer!!! It worked for me. Really a miracle. @ greenridinghood, you saved my 1 week time. Thanking you.

  • This worked.

  • This worked! Still an issue in some cases. If you have the PhaseScriptExecution issue, definitely try this! Thanks greenridinghood

This problem occured to me when I created a custom .swiftlint.yml config file in the project root. After deletion, it solved the problem
For me the error was in folder name, name contained spaces, inside which this project was setup.
After removing space, it worked

I got this error for pod .sh file but not sure why this issue came. This command fixed the issue.

In Terminal type command "chmod +x <path of .sh file> " then clean and build the project again. This solved my issue

Run the following commands from the project directory terminal :

% pod deintegrate

% pod install

Clean build

Add a Comment