Home > database >  Command PhaseScriptExecution failed with a nonzero exit code - Xcode 13.4.1
Command PhaseScriptExecution failed with a nonzero exit code - Xcode 13.4.1

Time:10-22

I'm using M1 chip and xCode 13.4.1. I get the following React Native error while executing the app in the simulator:

The following build commands failed: PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/Ibra/Library/Developer/Xcode/DerivedData/Mario-girhlsdkqiibhqhflwlyrybpo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-46EB2E110.sh (in target 'FBReactNativeSpec' from project 'Pods') (1 failure)

The problem persists even when I start a brand-new React Native project and try to execute it on iOS. What led to the error and how can it be fixed?

Thank you

CodePudding user response:

Same problem with M2 and Expo and subsequent native build

CodePudding user response:

it has multiple solutions:

  1. to solve this run this command in terminal in ios folder , pod deintergrate and install pod with the commad pod install
  2. Restart your Mac , it is some time due to cache, delete derived data and logs from XCode -> Prefrences and location

CodePudding user response:

I faced same issue and I figured out following solutions:

  • What worked for me was npx react-native-clean-project and choosing y for all options, this will clean your React Native project by purging caches and modules, and reinstalling them again.

And here're some solutions that worked for others:

  • If you're using nvm, nvm unalias default could solve the issue.
  • This error could be due to Xcode can't find your node path, so try sudo ln -s $(which node) /usr/local/bin/node
  • Delete node_modules then cd ios && pod deintegrate then reinstall node modules and npx react-native start --reset-cache
  • Related