react-native No bundle URL present
I resolved it with the following solution:
Edit <your_project_folder>/ios/<project_name>/AppDelegate.m
and change the jsCodeLocation
variable as follows:
jsCodeLocation =
[NSURL URLWithString:@"http://127.0.0.1:8081/index.ios.bundle?platform=ios&dev=true"];
For those still interested i resolved this just by running
react-native start
which starts the packager in the current terminal window and run in other terminal window
react-native run-ios
This happens to me when I work on the same react-native project on different computers. Closing the simulator and deleting the ios > build
folder followed by running react-native run-ios
again solves it for me.
Your issue is that the file main.js
bundle part of iOS is not generated all the times or sometimes is generated, but wrong. To solve the issue, follow these steps:
Add the following line inside the scripts of the
package.json
"build:ios": "react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'"
Then run following command:
yarn build:ios or npm run build:ios
Open Xcode, select "project", then click the project name; go to the "build phases", then click on "copy build resources" as your
main.js
bundle thereRun the
react-native run-ios
This works for me