Reputation: 13
React-rncore issues Command PhaseScriptExecution failed with a nonzero exit code
I've been trying to use React Native in a macOS Sonoma m2 chip, with the react-native-cli. Following the documentation of RN setting up the environment for macOS IOS, is not working for me and this is why.
First, I tried the following process.
Everything installed correctly, but when hitting run in Xcode, the build failed giving me the logs of “Command PhaseScriptExecution failed with a nonzero exit code”. I don’t know if this has to do with the changes I made in the process, like the permissions from point number 4 (I was not able to open the file if I didn’t change permissions) or maybe instead of bundle exec pod install I ran sudo bundle exec pod install --allow-root
I know I can install cocoapods by using Homebrew or Gems, and I tried this:
Run brew install cocoapods or sudo gem install cocoapods Then I saw in some forums that for mac m1/m2 chips, it was necessary to install sudo gem install ffi -n /usr/local/bin Then run in the /ios folder pod install in my case, thanks to permissions errors, it was sudo pod install --allow-root
React Native Version
0.73.4
Affected Platforms
Runtime - iOS
Output of npx react-native info
System:
OS: macOS 14.3
CPU: (12) arm64 Apple M2 Pro
Memory: 87.56 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 21.6.1
path: ~/.nvm/versions/node/v21.6.1/bin/node
Yarn:
version: 1.22.21
path: ~/.nvm/versions/node/v21.6.1/bin/yarn
npm:
version: 10.2.4
path: ~/.nvm/versions/node/v21.6.1/bin/npm
Watchman:
version: 2024.01.22.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.15.2
path: /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.2
- iOS 17.2
- macOS 14.2
- tvOS 17.2
- visionOS 1.0
- watchOS 10.2
Android SDK:
API Levels:
- "33"
- "34"
Build Tools:
- 34.0.0
System Images:
- android-33 | Google APIs ARM 64 v8a
- android-33 | Google Play ARM 64 v8a
- android-34 | Google APIs ARM 64 v8a
- android-UpsideDownCakePrivacySandbox | Google Play ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2023.1 AI-231.9392.1.2311.11330709
Xcode:
version: 15.2/15C500b
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.10
path: /usr/bin/javac
Ruby:
version: 3.3.0
path: /Users/muhammadhuzaifajunaid/.rubies/ruby-3.3.0/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.73.4
wanted: 0.73.4
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
Command PhaseScriptExecution failed with a nonzero exit code Build failed
I want run the build at IOS platform with latest with React Native version (0.73.4) for macOS Sonoma m2 apple chip with Xcode 15.2 version
Upvotes: 1
Views: 1986
Reputation: 1212
First remove the space from the parent folder name inside which the react native project place.
For Example: React Native/YourProjectName -> React-Native/YourProjectName
Note: Remove space from folder Name inside which the react native projects place
After removing space from the folder name follow the below steps
Remove Pods and Podfile.lock folder inside ios
Reinstall Pods
Upvotes: 2