react-nativeexpoxcode11

"Command PhaseScriptExecution failed with a nonzero exit code" when archiving


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:

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

enter image description here

So please if anyone has any ideas why this is happening, please?

error screenshot


Solution

  • 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 expo-cli@3.19.2 or higher

    npm install -g expo-cli
    

    -

    Note: Solution 1 is the answer to this question

    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