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:
- to solve this run this command in terminal in ios folder ,
pod deintergrateand install pod with the commadpod install - 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-projectand choosingyfor 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 defaultcould 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_modulesthencd ios && pod deintegratethen reinstall node modules andnpx react-native start --reset-cache
