Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No bundle URL present (react native)

Tags:

react-native

Just installed react native and trying to get Hello World up and running. Been receiving this error for the last few hours:

 "No bundle URL present.Make sure you're running a packager server  or have included a .jsbundle file in your application bundle." 

I've referred to this: What means of no bundle URL present in react-native? and other similar questions, and tried everything: using my ip addresse, different combos of react-native run-iso and npm install while running and not running, tried deleting builds, cleaning project, restarting Xcode, simulator multiple times, tried react-native-upgrade, edited into.plist to allow arbitrary loads, manually setting the path to my index.ios.js, everything, and nothing works.

I noticed many ran into this issue when trying to build on their device. i'm not trying to do anything fancy, just get 'hello world' up and running.

Any other solutions I am not aware of?

like image 927
jjjjjjjj Avatar asked May 13 '17 05:05

jjjjjjjj


People also ask

What is the meaning of no bundle URL present in react native?

It usually means that your metro bundler is not running, some people run that in their own terminals or on the standard computer terminal. I usually close the terminal, restart the app and that fixes it.


2 Answers

cd into YOUR_PROJECT/ios and rm -r build, then run again react-native run-ios

like image 124
goksel Avatar answered Sep 24 '22 03:09

goksel


I have the same issue, my problem was with info.plist I just config it as the following:

<key>NSAppTransportSecurity</key>     <dict>         <key>NSAllowsArbitraryLoads</key>         <true/>         <key>NSAllowsArbitraryLoadsInWebContent</key>         <true/>         <key>NSAllowsLocalNetworking</key>         <true/>     </dict> 

from this solution https://stackoverflow.com/a/48471978/1627358

And then add Bash config file .bashrc with this command:

echo "alias rni=\"kill \$(lsof -t -i:8081); rm -rf ios/build/; react-native run-ios\"" >> ~/.bashrc; source ~/.bashrc 

Then run rni

from this solution https://stackoverflow.com/a/44080527/1627358

And it works fine with me.

like image 27
Hussam Kurd Avatar answered Sep 24 '22 03:09

Hussam Kurd