Command PhaseScriptExecution failed with NonZero exit code

This can be a annoying error while trying to run your code on a machine specially when your team is using a mix of intel and m series macs. A simple fix for the above issue will be to check “excluded architecture” and see if it contains the architecture you are trying to build for. You need to remove that architecture from there. Following steps will help you

  1. Open your Xcode project.
  2. In the project navigator, select your project to view the project settings.
  3. Select your target under the “Targets” section.
  4. Go to the “Build Settings” tab.
  5. In the search bar, type “Excluded Architectures” to quickly locate the relevant setting.
  6. Find the “Excluded Architectures” build setting.
  7. Double-click on the value field next to “Excluded Architectures” to edit it.
  8. Remove arm64 from the list of architectures.
  9. Ensure that your build settings are consistent across all configurations (e.g., Debug and Release). You might need to adjust the setting for each configuration.
  10. Clean and rebuild your project to apply the changes.

By following these steps, you should be able to remove arm64 from the excluded architectures in your Xcode project, allowing it to be built for that architecture as well.

A pat on the back !!