DEV Community

Cover image for Fixing a PhaseScriptExecution Failure on React Native
Andrei Xavier de Oliveira Calazans
Andrei Xavier de Oliveira Calazans

Posted on

Fixing a PhaseScriptExecution Failure on React Native

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.

The Problem

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:

PhaseScriptExecution error logs

Looking at the bottom you see that it failed to find the root/index.js file of the project.

PhaseScriptExecution error logs where build actually failed

While their start:ios NPM script call does set the entry path here that won't get picked up by Xcode.

The Fix

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.

Screenshot of where the build phases is located in Xcode

Top comments (1)

Collapse
 
patrick_muhire_9bf7d6c0a2 profile image
Patrick Muhire

lol i cant even see whats on your screenshot bro