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.

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

22

How to fix this?

This totally worked for me!

Xcode 13.3 beta

ios 13.2

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

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
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
15
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

Xcode 11 Command PhaseScriptExecution failed with a nonzero exit code
 
 
Q