EAS build fails after upgrading to SDK 47. "main.jsbundle does not exist"

I have been successfully running EAS build on my application for a few months now using SDK 44. However, today I upgraded to SDK 47 and since then my app has been failing to build with this error


❌  error: File /Users/expo/workingdir/build/ios/build/Build/Products/Release-iphonesimulator/Repstar.app/main.jsbundle does not exist. This must be a bug with React Native, please report it here: https://github.com/facebook/react-native/issues

▸ ** BUILD FAILED **
▸ The following build commands failed:
▸ 	PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/expo/workingdir/build/ios/build/Build/Intermediates.noindex/Repstar.build/Release-iphonesimulator/Repstar.build/Script-00DD1BFF1BD5951E006B06BC.sh (in target 'Repstar' from project 'Repstar')
▸ (1 failure)
** BUILD FAILED **
The following build commands failed:
	PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/expo/workingdir/build/ios/build/Build/Intermediates.noindex/Repstar.build/Release-iphonesimulator/Repstar.build/Script-00DD1BFF1BD5951E006B06BC.sh (in target 'Repstar' from project 'Repstar')
(1 failure)
Exit status: 65

I am using a Managed Workflow and am using eas-cli 2.7.1

I have followed the upgrade procedures outlined here https://blog.expo.dev/expo-sdk-47-a0f6f5c038af by updating expo-cli, eas-cli, and running eas-cli update. I then building using eas build -p ios --profile preview as I want a build to run on my simulator

hi there,

this impacted some projects and was fixed in [expo] Fix path inconsistencies when resolving app entry point during build phase by byCedric · Pull Request #20056 · expo/expo · GitHub - update the expo package version to expo@47.0.6 to get the fix

Hi Brents,

Thanks for the reply. I updated my expo package to @47.0.6 but my EAS Build is still failing with the same error. Any suggestions?

can you share a link to your build page?

i have a similar problem running local build on macbook with eas build after migrate to SDK 47

[RUN_FASTLANE] ⚠️  ld: duplicate method '+moduleName' in
┌─[category]: ExpoBridgeModule-a47b69734399e794e1bbb8b1489dcee9.o ExpoModulesCore/libExpoModulesCore.a
└─[class]: ExpoBridgeModule-6fcc84f9af2954bce1f03b540ffcc47e.o ExpoModulesCore/libExpoModulesCore.a

[RUN_FASTLANE] ⚠️  ld: method '+UIDatePickerMode:' in category from /Users/hmit/Library/Developer/Xcode/DerivedData/BScash-gkuhpdelryiswvciiaocdfmonbts/Build/Intermediates.noindex/ArchiveInter
[RUN_FASTLANE] ⚠️  ld: method '+UIUserInterfaceStyle:' in category from /Users/hmit/Library/Developer/Xcode/DerivedData/BScash-gkuhpdelryiswvciiaocdfmonbts/Build/Intermediates.noindex/ArchiveI
[RUN_FASTLANE] ⚠️  ld: method '+UIStatusBarAnimation:' in category from /Users/hmit/Library/Developer/Xcode/DerivedData/BScash-gkuhpdelryiswvciiaocdfmonbts/Build/Intermediates.noindex/ArchiveI
[RUN_FASTLANE] ⚠️  ld: method '+UIDatePickerMode:' in category from /Users/hmit/Library/Developer/Xcode/DerivedData/BScash-gkuhpdelryiswvciiaocdfmonbts/Build/Intermediates.noindex/ArchiveInter
[RUN_FASTLANE] › Generating debug BScash » BScash.app.dSYM
[RUN_FASTLANE] › Executing BScash » Bundle React Native code and images
[RUN_FASTLANE]     the transform cache was reset.
[RUN_FASTLANE] 
❌  error: File /Users/hmit/Library/Developer/Xcode/DerivedData/BScash-gkuhpdelryiswvciiaocdfmonbts/Build/Intermediates.noindex/ArchiveIntermediates/BScash/BuildProductsPath/Release-iphoneos/


[RUN_FASTLANE]     Run script build phase '[CP-User] Generate app.config for prebuilt Constants.manifest' will be run during every build because it does not specify any outputs. To address th
[RUN_FASTLANE]     Run script build phase '[CP-User] Generate app.manifest for expo-updates' will be run during every build because it does not specify any outputs. To address this warning, e
[RUN_FASTLANE] ▸ ** ARCHIVE FAILED **
[RUN_FASTLANE] ▸ The following build commands failed:
[RUN_FASTLANE] ▸ 	PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/hmit/Library/Developer/Xcode/DerivedData/BScash-gkuhpdelryiswvciiaocdfmonbts/Build/Intermediates.n
[RUN_FASTLANE] ▸ (1 failure)
[RUN_FASTLANE] ** ARCHIVE FAILED **
[RUN_FASTLANE] 
[RUN_FASTLANE] 
[RUN_FASTLANE] The following build commands failed:
[RUN_FASTLANE] 	PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/hmit/Library/Developer/Xcode/DerivedData/BScash-gkuhpdelryiswvciiaocdfmonbts/Build/Intermediates.noindex/A
[RUN_FASTLANE] (1 failure)
[RUN_FASTLANE] Exit status: 65
[RUN_FASTLANE] +-------------+-------------------------+
[RUN_FASTLANE] |           Build environment           |
[RUN_FASTLANE] +-------------+-------------------------+
[RUN_FASTLANE] | xcode_path  | /Applications/Xcode.app |
[RUN_FASTLANE] | gym_version | 2.208.0                 |
[RUN_FASTLANE] | sdk         | iPhoneOS16.1.sdk        |
[RUN_FASTLANE] +-------------+-------------------------+
[RUN_FASTLANE] Looks like fastlane ran into a build/archive error with your project
[RUN_FASTLANE] It's hard to tell what's causing the error, so we wrote some guides on how
[RUN_FASTLANE] to troubleshoot build and signing issues: https://docs.fastlane.tools/codesigning/getting-started/
[RUN_FASTLANE] Before submitting an issue on GitHub, please follow the guide above and make
[RUN_FASTLANE] sure your project is set up correctly.
[RUN_FASTLANE] fastlane uses `xcodebuild` commands to generate your binary, you can see the
[RUN_FASTLANE] the full commands printed out in yellow in the above log.
[RUN_FASTLANE] Make sure to inspect the output above, as usually you'll find more error information there
[RUN_FASTLANE] [!] Error building the application - see the log above
[RUN_FASTLANE] Error: Fastlane build failed with unknown error. See logs for the "Run fastlane" and "Xcode Logs" phases for more information.
Fastlane errors in most cases are not printed at the end of the output, so you may not find any useful information in the last lines of output when looking for an error message.
[CLEAN_UP_CREDENTIALS] Destroying keychain - /var/folders/jy/5b47wwcd3yqddh9739m_pqpw0000gn/T/turtle-v2-9dd6b964-97c6-4e00-a28f-ada588a874f1.keychain
[CLEAN_UP_CREDENTIALS] Removing provisioning profile

Build failed
Fastlane build failed with unknown error. See logs for the "Run fastlane" and "Xcode Logs" phases for more information.
Fastlane errors in most cases are not printed at the end of the output, so you may not find any useful information in the last lines of output when looking for an error message.
    Error: npx exited with non-zero code: 1

My package.json

"dependencies": {
    "@expo-google-fonts/roboto": "^0.2.2",
    "@react-native-async-storage/async-storage": "~1.17.3",
    "@react-native-community/datetimepicker": "6.5.2",
    "@react-native-community/slider": "4.2.4",
    "@react-navigation/bottom-tabs": "^6.2.0",
    "@react-navigation/material-top-tabs": "^6.2.2",
    "@react-navigation/native": "^6.0.1",
    "@react-navigation/stack": "^6.0.1",
    "@sentry/react-native": "4.2.2",
    "axios": "^0.21.1",
    "expo": "~47.0.6",
    "expo-application": "~5.0.1",
    "expo-barcode-scanner": "~12.0.0",
    "expo-camera": "~13.0.0",
    "expo-checkbox": "~2.2.2",
    "expo-clipboard": "~4.0.1",
    "expo-constants": "~14.0.2",
    "expo-dev-client": "~2.0.0",
    "expo-device": "~5.0.0",
    "expo-file-system": "~15.1.1",
    "expo-font": "~11.0.1",
    "expo-linking": "~3.2.3",
    "expo-local-authentication": "~13.0.2",
    "expo-location": "~15.0.1",
    "expo-media-library": "~15.0.0",
    "expo-notifications": "~0.17.0",
    "expo-permissions": "~14.0.0",
    "expo-secure-store": "~12.0.0",
    "expo-sharing": "~11.0.1",
    "expo-splash-screen": "~0.17.5",
    "expo-status-bar": "~1.4.2",
    "expo-store-review": "~6.0.0",
    "expo-system-ui": "~2.0.1",
    "expo-updates": "~0.15.5",
    "form-data": "^4.0.0",
    "intl": "^1.2.5",
    "lottie-react-native": "5.1.4",
    "moment": "^2.29.1",
    "moment-timezone": "^0.5.34",
    "react": "18.1.0",
    "react-dom": "18.1.0",
    "react-native": "0.70.5",
    "react-native-barcode-mask": "^1.2.4",
    "react-native-collapsible": "^1.6.0",
    "react-native-date-picker": "^3.4.2",
    "react-native-elements": "^3.4.2",
    "react-native-gesture-handler": "~2.8.0",
    "react-native-masked-text": "^1.13.0",
    "react-native-pager-view": "6.0.1",
    "react-native-paper": "^4.9.2",
    "react-native-reanimated": "~2.12.0",
    "react-native-responsive-fontsize": "^0.5.1",
    "react-native-safe-area-context": "4.4.1",
    "react-native-screens": "~3.18.0",
    "react-native-status-bar-height": "^2.6.0",
    "react-native-svg": "13.4.0",
    "react-native-tab-view": "^3.1.1",
    "react-native-toast-message": "^2.1.1",
    "react-native-web": "~0.18.7",
    "react-native-webview": "11.23.1",
    "react-navigation-stack": "^2.10.4",
    "sentry-expo": "~5.0.0",
    "styled-components": "^5.3.0"
  }

you should look at your full xcode logs. bundling is failing and the information is not presented in the abridged logs that are output during the build. Running builds on your own infrastructure - Expo Documentation

Brents,

I’d rather not share the link since the project is set to Hidden. I can post the full output of any logs here though

nobody is able to see the build page except for expo employees. you can email it to secure@expo.dev. but i’d suggest following this guide to find out the error: Troubleshooting build errors and crashes - Expo Documentation

it’s most likely a bug in your app javascript code

Thanks Brents,

Here’s the link.Failing Build

here’s the error from your xcode logs

+ /Users/expo/.nvm/versions/node/v16.13.2/bin/node /Users/expo/workingdir/build/node_modules/react-native/cli.js bundle --entry-file index.js --platform ios --dev false --reset-cache --bundle-output /Users/expo/workingdir/build/ios/build/Build/Products/Release-iphonesimulator/main.jsbundle --assets-dest /Users/expo/workingdir/build/ios/build/Build/Products/Release-iphonesimulator/Repstar.app
warning: the transform cache was reset.
                Welcome to Metro v0.72.3
              Fast - Scalable - Integrated


error resolveDependencies: Found duplicate dependency key 'undefined' in /Users/expo/workingdir/build/index.js.
Error: resolveDependencies: Found duplicate dependency key 'undefined' in /Users/expo/workingdir/build/index.js
    at resolveDependencies (/Users/expo/workingdir/build/node_modules/@react-native-community/cli-plugin-metro/node_modules/metro/src/DeltaBundler/graphOperations.js:484:13)

also, be sure to refer to the expo doctor phase:

In my case this was due to some files not being uploaded to EAS as result of .gitignore. When I do builds I tweak my .gitignore file so those files are not ignored.

how did you know what files are causing the problem and how did you solve it , i am stuck on this issue for days please help

Maybe post your .gitignore file?

The most likely thing would be something like .env or maybe google-services.json or something like that.

@anka.ahmad Download the XCode logs from the Expo build and look towards the bottom. It’ll give you your specific error that isn’t presented in the abridged logs on Expo.