Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: main.jsbundle does not exist. This must be a bug with React Native #4

Open
ThinhPhan opened this issue Apr 21, 2021 · 0 comments
Labels
Apple Silicon M1 🍏 Bad Apple! bug 🐛 Something isn't working React Native

Comments

@ThinhPhan
Copy link
Owner

Description

When building for Release

Reproduction

Additional Information

Solution

There are many cases that lead to this bug. And the root cause always point to 1 things bundle files.

Run bundle file manually (add to package.json > scripts). RN will bundle and generate main.jsbundle

"build-ios": "react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios",
 "build-android": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res",

Case 1: Check missing file in XCode > Targets App > Build Phase > Copy Bundle Resources
If not exist then add it
xcode- add main jsbundle into

Case 2: Disable script in XCode > Target App > Build Phase > Bundle React Native code and images
Comment out the react-native-xcode.sh then run bundle manually then Archive will success.
xcode - comment out script

Case 3: Update script in XCode > Target App > Build Phase > Bundle React Native code and images
Sometimes your node is install by nodeenv so you need to specify the path

References
https://stackoverflow.com/a/54645100/741197

@ThinhPhan ThinhPhan added bug 🐛 Something isn't working React Native Apple Silicon M1 🍏 Bad Apple! labels Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Apple Silicon M1 🍏 Bad Apple! bug 🐛 Something isn't working React Native
Projects
None yet
Development

No branches or pull requests

1 participant