Command PhaseScriptExecution failed with a nonzero exit code
See original GitHub issueDescription
Trying to load a public react-native project: https://github.com/dramsay9/reactnative-attentionapp and got the below error in Xcode:
/bin/sh -c /Users/zhongs/Library/Developer/Xcode/DerivedData/ReactNativeAttentionTestApp-bxdxpymlnyawuofimfjmwtyperdx/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/FBReactNativeSpec.build/Script-5F3DB3CFA631AC0192B75E29E50D22E5.sh
Command PhaseScriptExecution failed with a nonzero exit code
Configuration did to run this project:
- Added GoogleService-Info for Firebase
- Delete Podfile.lock, xcworkspace and pod install
- Update developer profiles
- Removed Flipper (as it’s not used and causing errors)
Version
0.67.2
Output of npx react-native info
info Fetching system and libraries information… System: OS: macOS 12.5 CPU: (8) x64 Intel® Core™ i7-8569U CPU @ 2.80GHz Memory: 185.62 MB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node Yarn: Not Found npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm Watchman: 2022.08.15.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: Not Found IDEs: Android Studio: 2021.1 AI-211.7628.21.2111.8193401 Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild Languages: Java: 1.8.0_332-internal - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.67.2 => 0.67.2 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
Both “run” using Xcode and npx react-native run-ios --device “” gives the same error.
Snack, code example, screenshot, or link to a repository
Results using npx react-native run-ios --device "
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/zhongs/Library/Developer/Xcode/DerivedData/ReactNativeAttentionTestApp-bxdxpymlnyawuofimfjmwtyperdx/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/FBReactNativeSpec.build/Script-5F3DB3CFA631AC0192B75E29E50D22E5.sh (in target 'FBReactNativeSpec' from project 'Pods')
(1 failure)
react-native doctor:
✓ Node.js
✖ yarn
- Version found: N/A
- Version supported: >= 1.10.x
✖ Watchman - Used for watching changes in the filesystem when in development mode
- Version found: 2022.08.15.00
- Version supported: 4.x
Android
✓ JDK
✓ Android Studio - Required for building and installing your app on Android
✖ Android SDK - Required for building and installing your app on Android
- Versions found: N/A
- Version supported: 30.0.2
✖ ANDROID_HOME
iOS
✓ Xcode - Required for building and installing your app on iOS
✓ CocoaPods - Required for installing iOS dependencies
● ios-deploy - Required for installing your app on a physical device with the CLI
env:
NVM_INC=/Users/zhongs/.nvm/versions/node/v16.17.0/include/node
NVM_RC_VERSION=
TERM_PROGRAM=Apple_Terminal
NVM_CD_FLAGS=
SHELL=/bin/bash
TERM=xterm-256color
TMPDIR=/var/folders/84/85yg3v756w90md_90mkspt3d0j0qsw/T/
TERM_PROGRAM_VERSION=445
OLDPWD=/Users/zhongs/Desktop/React_native/reactnative-attentionapp-main/ios
TERM_SESSION_ID=D150D757-B20D-4816-8388-2F719173DFCA
NVM_DIR=/Users/zhongs/.nvm
USER=zhongs
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.6jxunqy4sX/Listeners
PATH=/Users/zhongs/.nvm/versions/node/v16.17.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands
__CFBundleIdentifier=com.apple.Terminal
PWD=/Users/zhongs/Desktop/MediaLab/visual_comfort/React_native/reactnative-attentionapp-main
XPC_FLAGS=0x0
XPC_SERVICE_NAME=0
SHLVL=1
HOME=/Users/zhongs
LOGNAME=zhongs
LC_CTYPE=UTF-8
NVM_BIN=/Users/zhongs/.nvm/versions/node/v16.17.0/bin
_=/usr/bin/env
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:15
Top GitHub Comments
I tried to follow the guideline for creating a new project: https://reactnative.dev/docs/environment-setup and got the error in this post again. So I guess there were some fundamental setup issues. I found this post: https://stackoverflow.com/questions/66742033/phasescriptexecution-cp-user-error-in-react-native and discovered the nvm installed by homebrew that I missed out in the removing process.
So I did the following and finally move on from this error and the app runs 😃. Many thanks!
Same as your. I use M1. Check out this solution https://stackoverflow.com/questions/55235825/error-failed-to-build-ios-project-we-ran-xcodebuild-command-but-it-exited-wit
If it don’t work, I’m out of solutions.