I have developed a React Native project and attempted to execute the iOS build through Xcode. However, each attempt results in a failure with the error message "Command PhaseScriptExecution failed with a nonzero exit code." What steps should I take to troubleshoot and resolve this issue?
Project Configuration
react-native:0.73.5
react: 18.2.0
node: 18.17.0
Xcode version: 15.3(15E204a)
System Configuration:
MacOS: Sonoma 14.2.1
Chip: M1
Memory: 8GB
To address this, I have already taken the following actions:
- Deleted the pods and reinstalled them.
- Cleaned the build and attempted to run the project again.
- deleted derivedData files and tried to run again
2
Answers
Delete this file fixed the issue:
ios.xcode.env.local
Have you added any shell script to your scheme or in build phases?
It not, Have to tried to add OpenSSL to your project ?
In order to do so, go to your
target
and selectbuild phases
. then selectLink Binary With Libraries
, click on the plus sign and search for OpenSSLNext do the following steps:
Product
and selectClean Build Folder
.That helped me when initialize new react native project.
Hope that will help you as well.