iosxcodereact-nativebuild-errorxcode15

Command PhaseScriptExecution failed with a nonzero exit code in FBReactNativeSpec on Xcode 15.4


I'm encountering an issue while trying to run/build my React Native project in Xcode 15.4. The error occurs in the FBReactNativeSpec and the build fails with the following message:

Command PhaseScriptExecution failed with a nonzero exit code

Details:

React Native Version: 0.71.8 Xcode Version: 15.4 macOS Version: macOS 14.5

What I've Tried:

  1. Cleaning the build folder: Product > Clean Build Folder
  2. Reinstalling npm packages: Deleted node_modules and ran npm install (or yarn install)
  3. Reinstalling pods: Deleted Pods folder and Podfile.lock and ran pod install in the ios directory
  4. Clearing Derived Data: Deleted contents of ~/Library/Developer/Xcode/DerivedData
  5. Updating React Native and related packages: Ensured all dependencies are up-to-date Despite these efforts, the error persists.

Has anyone else encountered this issue or can provide guidance on how to resolve it?


Solution

  • When I cloned my repository, I renamed it from "WalletClone" to "WalletClone Copy", introducing a space. This caused the above error.

    Solution

    1. To fix this issue, I renamed the repository to "WalletClone_Copy", ensuring there are no spaces in the name.
    2. Then clean and build