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

18

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

Nothing works for me. Even I've searched and tried any solutions over the three days...

I'm in the process of re-adding dependencies for a project to bring them up to date, and I see this error message when a dependency is missing. The specific reason for the error -- in my case, which dependency is missing -- is shown in my build logs, which I view in Xcode by double clicking the error in the sidebar. Here's a sample log:

Error: Unable to resolve module @react-navigation/stack from /Users/s/Work/dev/js/myrn/interflexion/navigation/MainStack.js: @react-navigation/stack could not be found within the project or in these directories:  node_modules

If you are sure the module exists, try these steps:  1. Clear watchman watches: watchman watch-del-all  2. Delete node_modules and run yarn install  3. Reset Metro's cache: yarn start --reset-cache  4. Remove the cache: rm -rf /tmp/metro-* [0m [90m 1 |[39m [36mimport[39m [33mReact[39m [36mfrom[39m [32m'react'[39m[33m;[39m[0m [0m [90m 2 |[39m [36mimport[39m { [33mView[39m[33m,[39m [33mImageBackground[39m[33m,[39m [33mButton[39m } [36mfrom[39m [32m'react-native'[39m[0m [0m[31m[1m>[22m[39m[90m 3 |[39m [36mimport[39m { createStackNavigator } [36mfrom[39m [32m'@react-navigation/stack'[39m[33m;[39m[0m [0m [90m  |[39m                    [31m[1m^[22m[39m[0m [0m [90m 4 |[39m[0m [0m [90m 5 |[39m[0m [0m [90m 6 |[39m[0m   at ModuleResolver.resolveDependency (/Users/s/Work/dev/js/myrn/interflexion/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:129:15)   at DependencyGraph.resolveDependency (/Users/s/Work/dev/js/myrn/interflexion/node_modules/metro/src/node-haste/DependencyGraph.js:288:43)   at Object.resolve (/Users/s/Work/dev/js/myrn/interflexion/node_modules/metro/src/lib/transformHelpers.js:129:24)   at resolve (/Users/s/Work/dev/js/myrn/interflexion/node_modules/metro/src/DeltaBundler/traverseDependencies.js:396:33)   at /Users/s/Work/dev/js/myrn/interflexion/node_modules/metro/src/DeltaBundler/traverseDependencies.js:412:26   at Array.reduce ()   at resolveDependencies (/Users/s/Work/dev/js/myrn/interflexion/node_modules/metro/src/DeltaBundler/traverseDependencies.js:411:33)   at processModule (/Users/s/Work/dev/js/myrn/interflexion/node_modules/metro/src/DeltaBundler/traverseDependencies.js:140:31)   at processTicksAndRejections (node:internal/process/task_queues:96:5)   at async addDependency (/Users/s/Work/dev/js/myrn/interflexion/node_modules/metro/src/DeltaBundler/traverseDependencies.js:230:18) info Run CLI with --verbose flag for more details. Command PhaseScriptExecution failed with a nonzero exit code

Running this command fixed it for me:

sudo ln -s $(which node) /usr/local/bin/node

This is still an ongoing problem. macOS 12.3 & Xcode 13.3 are fully up-to-date. Cleaned build folder and freshly integrated pods. Building will throw the same error.

We have tried all of the solutions short of locking the keychain (because apparently we cant do that anymore? the option is disabled) but alas, nothing has worked. Neither Login or local can be locked.

The only "solution" we have found to this problem is to restart the computer. Why? Great question! I don't know. I suspect its locking/unlocking the keychain which rectified whatever cert build error is occurring but its ridiculous to have to go to such lengths. Logging off of the user also does not help. It has to be a full reboot.

"nvm unalias default" fixed it.

After days of having a similar problem as yours, I did the following:

  • Follow this StackOverflow answer
  • Completely close all terminals & close XCode
  • Reopen XCode to successfully start compiling & archiving iOS builds 🚀

Try this simple trick.. : https://not.justsolutionsproducts.com/xcode-11-command-phasescriptexecution-failed-with-a-nonzero-exit-code/

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

I can't also find a solution for this problem, the problem occurred in my application after I enable email/password dependency in firebase. I tried to run my application but this error occurred.

Xcode 11 Command PhaseScriptExecution failed with a nonzero exit code
 
 
Q