so I have an app built with Expo but then ejected to get ios and android folder everything works fine on both android and ios I have published it for android but on ios when I try to archive the project it gives me an error Command PhaseScriptExecution failed with nonzero exit code
i don't know what's causing this error I have read a lot of StackOverflow questions tried a lot of things but with no luck here's what I tried so far.
I tried:
pod deintegrate
,
doing pod update
Okay so before, building with Command+B
also didn't work but now i went to Targets->App name->build phases->bundle expo assets-> and checked the " run script only while installing" option and building started working but archiving still doesn't work
along with the above error i also noticed another error on xcode
So please if anyone has any ideas why this is happening, please?
One possible reason could be that Xcode is using an outdated version of Node (in my case, it was because I use nvm to manage my Node versions, but Xcode used an old version of Node that I had installed via HomeBrew a long time ago).
By default, Xcode will use the Node binary located at /usr/local/bin/node
. Check its version by running:
/usr/local/bin/node -v
node -v
If the first command outputs an older version of Node, simply delete it and replace it with a symlink to the newer one:
rm -rf /usr/local/bin/node
ln -s $(which node) /usr/local/bin/node
If you are using nvm, unsetting the default alias fixes the issue.
$ nvm unalias default
or if it asking to set nvm default:
$ nvm alias default node
Build the app again.
Solution 1:
it is due to Bare Expo Bundle Assets
here is the actual issue raised on forum: https://forums.expo.io/t/ios-bundle-assets-error-when-building-release-403/36616
this pull (fix) request has merged into master
-
Solution:
update your expo-cli to [email protected] or higher
npm install -g expo-cli
-
Solution 2:
Open project directory on the terminal and run this command and archive again
react-native bundle --platform ios --dev false --entry-file index.js --bundle-output ./ios/main.jsbundle
Solution 3:
Go to
Keychain Access
-> Right-click on login
-> Lock & unlock again
-> Clean Xcode project
->Make build again
This issue for me was that I had the project in a directory with spaces in the name. An intermediate script that FBReactNativeSpec builds is referencing paths without escaping spaces, so it failed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With