Apple’s devices are known for their top-notch build quality and software experience. However, much of that software experience depends on skilled developers building proper apps that match Apple’s requirements.
However, developing iOS isn’t always a cakewalk and requires jumping through a bunch of hoops to get an app right. This article discusses the “Xcode command PhasScriptExecution failed with a nonzero exit code” error and what you can do to fix the problem.
Also read: Flutter vs React Native vs Ionic vs Xamarin
Reinstall your pod
Rebuilding your pod can fix this error as it’s mainly caused by a faulty, non-functioning script. Just navigate to your project’s root directory and enter the following commands one after another.
pod deintegrate pod install
After this, fire up Xcode, head over to Product and then click Clean Build Folder. Now try running your app again, and it should work just fine.
Unlock keychain Access
At times, incorrect keychain access can also cause random scripts or your entire project not to work as expected. To fix this, head to Keychain Access in Xcode; under Login, select Lock followed by Unlock. Once you’re done, restart Xcode, clean your project and try running the build again.
Enable Pod frameworks
If you’re using pods without enabling the supporting frameworks, the error can get triggered as you’re trying to access a resource without the necessary framework possible.
To fix this, head over to Target followed by Build Phases and enable Embedded pods frameworks. Sometimes the setting might be labelled as Bundle React Native code and images, so be sure to check all options thoroughly.
Once you’re done, try running your scripts again and build the project from scratch. You shouldn’t see the error anymore.
Someone who writes/edits/shoots/hosts all things tech and when he’s not, streams himself racing virtual cars. You can reach out to Yadullah at [email protected], or follow him on Instagram or Twitter.