When XCode 14.3 was released a new error message began appearing when attempting to build your app for release (clicking Product > Archive):
"Command PhaseScriptExecution failed with a nonzero exit code"
This ends up being an issue related to Cocoapods and was reported as an issue here:
https://github.com/CocoaPods/CocoaPods/issues/11808
The fix for it has been released in Cocoapods 1.12.1.
What Version Do I Have?
You can run the following at the command line:
pod --version
The last time you installed or updated Cocoapods was likely when you tried Capacitor for the first time and followed the environment setup docs. It is probably older than 1.12.1 and is missing many fixes.
How do I Upgrade CocoaPods?
To upgrade to the latest version of CocoaPods run:
gem install cocoapods --user-install
Note: Some users prefer to use Homebrew, you can find out if you are using Homebrew by running the command which pod which will return a path that includes the word "homebrew". If that is the case then you can run brew install cocoapods.
After installation run pod --version and ensure your version is >= 1.12.1
Important: Run cap sync
After installing Cocoapods you must close XCode, then run cap sync:
npx cap sync
After syncing you can then open XCode and click Product > Archive and it should now work.
Note: You can also build your app at the command line with npx cap build ios
Happy Upgrading!
Comments
0 comments
Please sign in to leave a comment.