4

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

8 Answers 8

5

Solution: It's node version mismatch version.

During the initial execution of 'pod install,' a file named '.xcode.env.local' was automatically generated in the '/ios' directory. This file contained the line

'$NODE_BINARY=/opt/homebrew/Cellar/node/20.8.0/bin/node.'

To know the exact path of Node I typed "which node" whatever you get just paste that path inside '.xcode.env.local' file.

I resolved the problem by updating this line only.

Sign up to request clarification or add additional context in comments.

Comments

3

Described answers didn't help me, but I started reading error description: and I found out that in error description on the line 2: my folder's name was written partially. Folder name consisted 2 words divided by 1 space example: "My folder" in the error was written just "My". I just changed folder's name to "MyFolder" and it helped me to fix the problem

Comments

2

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

Comments

0

I solve this issue with below procedure:

  1. Keychain Access > Cetificates > Login
  2. Find any Apple Certificate that has the blue + symbol
  3. Change it to "Use System Defaults" and close it.
  4. You'll see a pop up. Type in your password to update settings.
  5. Close Keychain. Open your project, clean build files and run.

Note: Mac with M1, Xcode 14.1

Comments

0

it has multiple solutions:

  1. to solve this run this command in terminal in ios folder , pod deintegrate 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

1 Comment

A little correction. Up here, where you put pod deintergrate should be pod deintegrate.
0

change react native version 0.65.0 this working

Comments

0

I faced the same issue in my react-native project,

I ran the project in XCode and got the above error without more explanation about why the application failed.

After that, I ran the project on Android, and then I got Js errors in Metro logs.

So I noticed that in order to view js errors I must run my project on android

If you are working with react-native and Metro And you are getting this error:

"Command PhaseScriptExecution failed with a nonzero exit code"

Try this solution:

Try to run your project on Android (or Chrome) and check if you are getting JS errors in Metro logs. Because in xCode JS errors not appear, and instead, the above error appears.

Comments

-2

Today I faced the same issue. Then downloaded Xcode 14.1. It is working without any issues.

Download it from here

https://download.developer.apple.com/Developer_Tools/Xcode_14.1/Xcode_14.1.xip

2 Comments

This is not a solution, you cannot remain in downgraded version forever. Still I appreciate your response, as it temporarily solves the problem for someone !
The question was asked when using Xcode 13.4.1. So I suggested to upgrade.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.