PhaseScriptExecution iOS Origin: On your device Last updated 13 Oct 2026

Xcode: Command PhaseScriptExecution failed with a nonzero exit code

A Run Script build phase (CocoaPods, React Native, Flutter, SwiftLint, Crashlytics…) failed. The real error is above this line in the build log.

Exact message you may see Command PhaseScriptExecution failed with a nonzero exit codeThe sandbox is not in sync with the Podfile.lock
Seen on: iOS

Meaning

Xcode only reports that a script failed. Open the Report navigator, expand the failing “Run custom shell script” step and read its output.

Common causes

  • CocoaPods out of sync (Pods/Manifest.lock mismatch)
  • Node not found by Xcode (React Native) — PATH differs from your shell
  • Flutter/Dart tool path or version issues
  • Script lacks execute permission or has CRLF line endings
  • User Script Sandboxing (Xcode 15+) blocking file access

⚡ Quick fix

  1. Expand the failing step in the Report navigator
  2. cd ios && pod install
  3. React Native: set NODE_BINARY in ios/.xcode.env.local
  4. Try ENABLE_USER_SCRIPT_SANDBOXING = NO for scripts that need file access
  5. Clean build folder (⇧⌘K) and DerivedData

Detailed fix by platform

iOS

  1. React Native Node path:
    bash
    echo "export NODE_BINARY=$(command -v node)" > ios/.xcode.env.local
    cd ios && pod install

How to diagnose

  1. Script — Which build phase failed?
  2. Output — What did it print before exit?
  3. Environment — PATH/tools visible to Xcode?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

CDN: trunk URL couldn't be downloaded — [!] CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/... (iOS)CDN: trunk URL couldn…CocoaPods compatible versions — CocoaPods could not find compatible versions for pod (iOS)CocoaPods compatible …CocoaPods: pod install failed / not installed — Flutter iOS: Error running pod install — CocoaPods not installed or out of date / [!] CocoaPods could not find compatible versions for pod (Flutter / Dart)CocoaPods: pod instal…command not found — bash: command not found (Linux)command not foundlibrary not found for -lPods — ld: library not found for -lPods-AppName / framework not found Pods_App (iOS)library not found for…Module 'x' not found (iOS build) — Xcode: Module 'firebase_core' not found — flutter build ios fails after adding a plugin (Flutter / Dart)Module 'x' not found …Multiple commands produce — Xcode: Multiple commands produce '…/Info.plist' (or another file) (iOS)Multiple commands pro…No signing certificate — Xcode: No signing certificate "iOS Development" found (iOS)No signing certificatePhaseScri…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.