EAS Build error (IOS)

When running eas build, I’m getting a fastlane build command failure. I can successfully build a release archive (.ipa) in XCode, so I’m not sure what issue I’ve ran into with eas build. I do have file reference issues it appears in XCode, but they’re not blocking to my XCode build.

[13:36:59]: ▸ The following build commands failed:

218Mon, 08 Feb 2021 21:36:59 GMT

[13:36:59]: ▸ 	PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images /Users/expo/Library/Developer/Xcode/DerivedData/redditalerts-{{KEY}}/Build/Intermediates.noindex/ArchiveIntermediates/redditalerts/IntermediateBuildFilesPath/redditalerts.build/Release-iphoneos/redditalerts.build/Script-00DD1BFF1BD5951E006B06BC.sh

219Mon, 08 Feb 2021 21:36:59 GMT

[13:36:59]: ▸ (1 failure)

220Mon, 08 Feb 2021 21:36:59 GMT


this means that your bundle is failing to compile. maybe you have a .env file on your machine but that’s not being uploaded (only files that aren’t .gitignore are uploaded) and so it fails to import, or something like that. try freshly cloning your project to another directory and building to see a similar error, most likely

1 Like

Thanks Brent, I know these questions must get routinely annoying and I appreciate your help.

The EAS ‘XCode logs’ shows a failing import, although it imports (and builds) locally with XCode and also via react-native run-ios. I do not have a custom metro config, and didn’t have one before or after I ejected to Bare.

Error: Error loading assets JSON from Metro. Ensure you've followed all expo-updates installation steps correctly. Unable to resolve module ./BuyModal from /Users/expo/project/build/screens/index.js:

it looks like you are unable to load a file called BuyModal.js from build/screens/index.js

i can’t really help with that, it is very specific to your project. perhaps you called it buymodal.js and committed it to git and then renamed it to BuyModal.js without using git mv? rename - Changing capitalization of filenames in Git - Stack Overflow

Hi Brent,

I took your advice of copying the repo and remaking Xcode project file from scratch and it finally built on EAS. Thank you.

1 Like

It seemed to be an issue with an outdated main.bundle.js.For others experiencing a file import error in Fastlane (used by EAS), but not in XCode, here’s what I did:

  1. yarn start --reset cache
  2. Delete podfile.lock and pods folder
  3. npx pod-install --repo-update
  4. Run react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios with whatever your entry file is. Your entry file should be index.js by default with an expo app, if it’s not, look for where you have registerRootComponent(App). I made this into a package.json script since I use it often.
  5. Then, run eas build -p ios
1 Like