This issue take me some days to fixed. I got this issue when run the build on travis-ci.
Here is my fix:
Add this line to scripts
in your package.json file.
"build:ios": "react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'"
Now your can run the command to generate main.jsbundle
.
yarn build:ios
or npm run build:ios
Open the Xcode > Select project target > add main.jsbundle
to Copy Bundle Resource
in Build Phases. (image below).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…