When contributing to react-native-share library I ran into an issue while building for iOS via Xcode.
Their example app lacked a build setting that caused the PhaseScriptExecution step to fail.
When building from Xcode I got this issue:
Command PhaseScriptExecution failed with a nonzero exit code
Expanding the error you see a ton of logs:
Looking at the bottom you see that it failed to find the
root/index.js file of the project.
start:ios NPM script call does set the entry path here that won't get picked up by Xcode.
Luckily for us that script phase is a build step within Xcode which we can change.
In the Example app's build phases, we can change
Bundle React Native code and images's shellscript that executes
react-native-xcode.sh and add the
ENTRY_FILE environment variable pointing to the right path.