DEV Community

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

Posted on

16

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

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

Top comments (1)

Collapse
 
patrick_muhire_9bf7d6c0a2 profile image
Patrick Muhire

lol i cant even see whats on your screenshot bro

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay