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

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (1)

Collapse
 
patrick_muhire_9bf7d6c0a2 profile image
Patrick Muhire

lol i cant even see whats on your screenshot bro

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs