# PhaseScriptExecution failed with a nonzero exit code

> Getting the error “PhaseScriptExecution failed with a nonzero exit code”? Here is how to fix it. The real error is earlier in the log.

**PhaseScriptExecution failed with a nonzero exit code.** One of the project’s script phases exited with an error. This line is only the summary — the real error is printed earlier in the log.

- iOS build. A script inside the Xcode build failed.
- Interactive page: https://capwr.app/free-tools/build-error-explainer/phasescriptexecution-failed
- Build error explainer: https://capwr.app/free-tools/build-error-explainer
- Last updated: 2026-10-03

## What this error means

One of the project’s script phases exited with an error. This line is only the summary — the real error is printed earlier in the log.

## Why it happens

Xcode ran a Run Script phase, often the one that copies the web build, and that script exited non-zero. This line is the summary; the cause is earlier in the log.

## The message tools print

```
Command PhaseScriptExecution failed with a nonzero exit code
```

## How to fix it

1. Scroll up to the first error before this line and paste that here instead.
2. A frequent cause is a missing web build or Node not found — run npm run build and npx cap sync ios before building.

## Check a log that shows this

Paste the failing step into the [build error explainer](https://capwr.app/free-tools/build-error-explainer). It matches this message, and any others in the same log, in your browser. Nothing is uploaded.

## Other iOS build errors

- [No signing certificate "iOS Distribution" found](https://capwr.app/free-tools/build-error-explainer/no-signing-certificate)
- [No profiles for your bundle ID were found](https://capwr.app/free-tools/build-error-explainer/no-provisioning-profile)
- [Xcode: signing requires a development team](https://capwr.app/free-tools/build-error-explainer/requires-a-development-team)
- [Provisioning profile doesn't support the capability](https://capwr.app/free-tools/build-error-explainer/provisioning-profile-missing-capability)
- [Podfile.lock is not in sync with the sandbox](https://capwr.app/free-tools/build-error-explainer/podfile-lock-out-of-sync)
- [CocoaPods could not find compatible versions](https://capwr.app/free-tools/build-error-explainer/cocoapods-could-not-find-compatible-versions)
- [Undefined symbols for architecture arm64](https://capwr.app/free-tools/build-error-explainer/undefined-symbols-for-architecture)

## Stop signing this on a Mac

CapWrapp creates the Apple Distribution certificate from your App Store Connect API key and installs it, with the provisioning profile, on every GitHub Actions build.

[Get started free](https://capwr.app/login).

## About CapWrapp

CapWrapp turns a web app on GitHub — built with Lovable, Bolt, Base44, Cursor or by hand — into iPhone and Android apps. It adds Capacitor if the repo needs it, signs the builds, and ships them to TestFlight and Google Play from GitHub Actions, with no Mac or Xcode on your side. [Get started free](https://capwr.app/login) · [Lovable to App Store guide](https://capwr.app/guides/lovable-to-app-store)
