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.

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.

I have tired everything here, and my problem still sturbornly persists please, please help me

I have tried all the solutions here for iOS build with XCode 14.1 to solve the "PhaseScriptExecution failed..." issue in macOS Ventura but unfortunately did not solve it. Please anyone help me? Thanks in advance!

Bogus link from Alquopi6, DO NOT CLICK ON IT

Solved on my project/Machine by going on Xcode to: 'MyAppName' -> 'MyTargetName' -> BuildSettings -> ExcludedArchitectures -> (Remove all, in my case removing "arm64")

the solution for our project was to go to the Xcode->Preferences...->Accounts and remove a develop certificate and create a new one via "Manage certificate..." buttonp.s. and, perhaps, the good point is to remove all expired certificates too

Xcode 11 Command PhaseScriptExecution failed with a nonzero exit code
 
 
Q