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

No bundle url present #12754

soutot opened this issue Mar 7, 2017 · 192 comments

No bundle url present #12754

soutot opened this issue Mar 7, 2017 · 192 comments


Copy link

@soutot soutot commented Mar 7, 2017


I noticed some people recently asking about this "No bundle url present" error and I just faced it myself.


I had just run ˜react-native init projectName˜, setup my App.js file (a simple Hello World), called it in both iOS and Android indexes and run ˜react-native run-ios˜. Then the No bundle url present error appeared.


I tried to delete my node_modules and npm install, close the packager and run the project again, but it could only be solved when I follow the steps given here (

  • Run "react-native run-ios"
  • When the error appears, run "npm install"
  • Then run "react-native run-ios" again.

Additional Information

This is the first project I started using RN 0.42. Since it never happened before and I am not the only one facing this issue, I guess it should be taken a closer look to it.

Here's my package.json:

	"name": "myProject",
	"version": "0.0.1",
	"private": true,
	"scripts": {
		"start": "node node_modules/react-native/local-cli/cli.js start",
		"test": "jest"
	"dependencies": {
		"react": "~15.4.1",
		"react-native": "0.42.0"
	"devDependencies": {
		"babel-jest": "19.0.0",
		"babel-preset-react-native": "1.9.1",
		"jest": "19.0.2",
		"react-test-renderer": "~15.4.1"
	"jest": {
		"preset": "react-native"

If I can be more helpful to make any further test, it would be a pleasure.

Copy link

@edwardofclt edwardofclt commented Mar 7, 2017

Having the same issue now. Not sure what changed.

Copy link

@decadef20 decadef20 commented Mar 8, 2017

Same problem.

Copy link

@edwardofclt edwardofclt commented Mar 8, 2017

Copy link

@skv-headless skv-headless commented Mar 8, 2017

What if you run npm start in console?

Copy link

@qyvip qyvip commented Mar 8, 2017

Same problem.

I found
JsCodeLocation = [[RCTBundleURLProvider jsBundleURLForBundleRoot:@ sharedSettings] "index.ios" fallbackResource:nil];
Take effective address not, this happens in connection to the network situation (and not all networks such), when this happens, disconnected from the network, I think, in a virtual machine can run in localhost:8081
This is the way I am

Copy link

@edwardofclt edwardofclt commented Mar 8, 2017

Copy link

@edwardofclt edwardofclt commented Mar 8, 2017

Copy link

@qyvip qyvip commented Mar 8, 2017


Yes, this is the IOS code, I simply look at the code, here will automatically take the local IP, but obviously, did not take, Android I have not tried, but this is obviously different from the IOS code

My situation when I changed a network environment, it is normal, very clever, when I met the home
I try to print out the automatic access to the full address, are taken to return to the null, at the same time, APP will be waiting for the start of the case, this is the local address

NSLog (@ absoluteString:%@), [jsCodeLocation absoluteString]);
NSLog (@ host:%@), [jsCodeLocation host]);
NSLog (@ port:%@), [jsCodeLocation port]);

When I will

jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];

Modified into

jsCodeLocation = [NSURL URLWithString:@""];

This time can be a normal start, but after entering the application of remote image loading, it seems wrong
This is just a point of view, and there is no concrete solution

Copy link

@rmevans9 rmevans9 commented Mar 8, 2017

I have gotten that message when the packager is not running when the app is launched on iOS. Typically I have to completely kill the app and launch again after I have started the packager. Can you guys be sure that you have the packager running prior to launching the app?

Copy link

@soutot soutot commented Mar 8, 2017

@rmevans9 in my case the packager was running as always. The solution I posted is done while the packager and the app are running. That's the only way I found by now to handle this. I belive there's something going wrong when the modules are installed on react-native init. I have to do some tests before assurance it

Copy link

@qyvip qyvip commented Mar 8, 2017

Yes, the packager is already running. I can access it through the browser

Copy link

@despreston despreston commented Mar 8, 2017

I am also seeing this issue on RN 0.42.0

Copy link

@liqueflies liqueflies commented Mar 8, 2017


Copy link

@Mess1ah Mess1ah commented Mar 9, 2017

Same problem and I run "npm install" and "react-native run-ios" ,the problem seems to be not solved yet.

Copy link

@yustada yustada commented Mar 9, 2017

I am seeing same problem @0.42.0 and
"npm install" does not solve it.

Copy link

@yustada yustada commented Mar 9, 2017

My problem has been solved by adding NSAllowsLocalNetworking to Info.plist


I am not sure it is because of RN0.42 or iOS issue, but it is solved in my case.

Copy link

@akiver akiver commented Mar 12, 2017

Check if you have localhost in your hosts, clean the project and retry, it worked for me.

Copy link

@edwardofclt edwardofclt commented Mar 12, 2017

Copy link

@shivashp shivashp commented Mar 13, 2017

I found a working solution, Give it a try. While the simulator is running don't close your bundler. Go to the path and run npm install then again react-native run-ios. It started working for me.

Copy link

@adamnator92 adamnator92 commented Mar 13, 2017

i faced this issues after i moved my project to another directory and run ios simulator

Copy link

@jaxondu jaxondu commented Mar 13, 2017

This is working for me: leave simulator running, leave the packager terminal window on, and run react-native run-ios again.

Copy link

@powercoder23 powercoder23 commented Mar 13, 2017

This also means the "Port already in use"

Terminating a process on port 8081

Run the following command on a Mac to find the id for the process that is listening on port 8081:

$ sudo lsof -i :8081

Then run the following to terminate the process:

$ kill -9 <PID>

please try troubleshooting in below link


Copy link

@cesarkawakami cesarkawakami commented Mar 14, 2017

I'm just leaving this here, in case other people stumble upon the same cause.

In our team's case, during the migration to 0.42.0, we've accidentally removed the "Bundle React Native code and images" build phase from the XCode project.

Manually re-adding the phase solved the problem, but we're left scratching our heads as to when or how the phase was removed.


Copy link

@stantoncbradley stantoncbradley commented Mar 14, 2017

works for me when I build the app through xcode...

Copy link

@grundmanise grundmanise commented Mar 16, 2017

Same issue. Have set scheme to Release in Xcode and trying to archive the app for production, but main.jsbundle is not generating...

Copy link

@cutemachine cutemachine commented Mar 16, 2017

I had the same error and was able to run the app only through Xcode. react-native run-ios did not work. To resolve the issue you need to remove the build folder YOUR_PROJECT/ios/build/. After this you should be able to run your app through react-native run-ios again. Hope this helps.

Copy link

@pkral78 pkral78 commented Mar 16, 2017

For Debug configuration, which is default when new project is generated with react-native init command, build does not generate bundle file but instead uses packager for that. So the issue is related to network settings and is very likely related to proxy settings. If proxy is used, do not forget to set bypass proxy for localhost and addresses.

Copy link

@gperdomor gperdomor commented Mar 16, 2017

Same here... Install the node packages again is not a proper solution

Copy link

@archywillhe archywillhe commented Mar 16, 2017

In my case it was because I was running Shadowsocks (being in China at the moment) and I didn't set it to bypass and localhost. Thanks @om2pkral for mentioning that.

Copy link

@yoonchulkoh yoonchulkoh commented Mar 18, 2017

In my case, nothing was displayed on the other terminal that started up when react-native run-ios was executed.
It means that packager is not running.

So I was able to start packager by running PROJECT_DIR/node_modules/react-native/packager/launchPackager.command myself.
I run react-native run-ios again, it started up normally.

I don't know the cause, but the behavior of the open command below is doubtful.

shellScript = "if [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\nif nc -w 5 -z localhost 8081 ; then\nif ! curl -s \"http://localhost:8081/status\" | grep -q \"packager-status:running\" ; then\necho \"Port 8081 already in use, packager is either not running or not running correctly\"\nexit 2\nfi\nelse\nopen \"$SRCROOT/../packager/launchPackager.command\" || echo \"Can't start packager automatically\"\nfi\nfi";

Copy link

@jjdraijer jjdraijer commented Jan 19, 2018

Try to

npm install metro

Solved it because of a bug

Copy link

@shadowbrush shadowbrush commented Jan 23, 2018

If anyone wants a script for turning on/off the transport security in Info.plist:

    var fs = require('fs');
    var plist = require('plist');

    function modifyIosTransportSecurity(plistPath, enable) {
      var info = plist.parse(fs.readFileSync(plistPath, 'utf8'));
      info.NSAppTransportSecurity.NSAllowsArbitraryLoads = !enable;
      info.NSAppTransportSecurity.NSAllowsArbitraryLoadsInWebContent = !enable;
      info.NSAppTransportSecurity.NSAllowsLocalNetworking = !enable;

I'm calling this from a pre- and post-build script that were added to XCode's build phases.

Copy link

@KangYoosam KangYoosam commented Jan 23, 2018

There are two apps(same project) on the simulator. Once I delete the new one, problem got resolved.

Copy link

@OrangeFlavoredColdCoffee OrangeFlavoredColdCoffee commented Jan 24, 2018


if you check this, Xcode cannot log some error ..uncheck it and find error
''undefined is not an object( evaluating '')''

and do like this:

1 import ViewPropTypes from react-native
2change View.propTypes to ViewPropTypes

and it work for me .
if you recently update your RN version ,you may have this .

i had this error only release mode. and dev mode work fine ..i have tried solutions nearly all above .but none works.

jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];

"react": "16.0.0-alpha.12",
"react-dom": "16.0.0-alpha.12",
"react-native": "0.51.0",

and a few days ago ,just update 0.44 to 0.51.0 . if this issues cant fixed. i will roll back to lower version have a try .

Copy link

@shaunsaker shaunsaker commented Jan 29, 2018

Not sure if this will help you guys but I changed my build config in Xcode (Product => Scheme => Edit Scheme) back to Debug and it worked.

Copy link

@infinito84 infinito84 commented Feb 1, 2018

This work for me:

react-native link
react-native run-ios
Copy link

@miniyarov miniyarov commented Feb 4, 2018

Based on this thread and some other there are a lot of errors causing this problem.
But mine was related with localhost domain. So make sure you have set localhost in your /etc/hosts for Linux/Unix or equivalent file on Windows.

Copy link

@bagana89 bagana89 commented Feb 8, 2018

if your project opened by xcode. please close the xcode and run again, it works for me

Copy link

@nabil-mansouri nabil-mansouri commented Feb 18, 2018

Hi guys,
I solved it on my device by replacing on AppDelegate.m:

jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];



Where IP_ADDRESS_ON_MY_LAN = 192.168....

Copy link

@monkingame monkingame commented Mar 1, 2018

I met the same issue after build release version(under ios).
I changed the followings and got normal result.
1)change AppDelegate.m codes:
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
and uncomment
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
2)re-enable ATS localhost in Info.plist
App Transport Security Settings -> Excepiton Domains -> localhost -> NSExceptionAllowsInsecureHTTPLoads -> TRUE
3)run react-native run-ios again and reload the app in simulator

Copy link

@JohnSmith0602 JohnSmith0602 commented Mar 3, 2018

@monkingame Thx, the localhost part saved my day!

Copy link

@FrankSandqvist FrankSandqvist commented Mar 3, 2018

@monkingame Thanks, the changing of comments worked for me. I have no idea what caused this error to start happening to begin with, started after I made the production build and wanted to back to debugging. How did that change the code location?

Copy link

@originalix originalix commented Mar 8, 2018

This work for me.

rm -rf ios/build
react-native run-ios
Copy link

@marcelotadeujr marcelotadeujr commented Mar 11, 2018

This work for me.

rm -rf ios/build/; kill $(lsof -t -i:8081);
react-native run-ios
Copy link

@alangumer alangumer commented Mar 13, 2018

yarn start or npm start
to start the development server

if necessary run again:
react-native run-ios

Copy link

@lucidtheory lucidtheory commented Mar 20, 2018

For me for some reason the jsCodeLocation changed in AppDelegate.m

make sure it is
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];

Copy link

@GemN GemN commented Mar 22, 2018

From another thread after trying everything, that solution worked:

"this is solved my issue:
info.plist → information Property List → + App Transport Security Settings → + Allow Arbitrary Loads = YES"

Copy link

@rishabh-saxena rishabh-saxena commented Mar 24, 2018

I got it resolved by including the below code in Info.plist file which I had removed from the production build.
<key>NSAppTransportSecurity</key> <dict> <key>NSExceptionDomains</key> <dict> <key>localhost</key> <dict> <key>NSExceptionAllowsInsecureHTTPLoads</key> <true/> </dict> </dict> </dict>

Copy link

@mikenk2010 mikenk2010 commented Mar 27, 2018

Easy boy, just remove ios/build (rm -rf ios/build) then run react-native run-ios again! Take me 30m to figure out...LOL...

Copy link

@yogeshR5 yogeshR5 commented Apr 3, 2018

@jiteshwadia same problem occurred to me.
what I have to do now??

Copy link

@bjacobs09 bjacobs09 commented Apr 5, 2018

For me, I was having a problem with Node not being recognized in any new tab opened. So I have to use nvm use in every new tab. Because the bundler was opening in a new tab when I ran npm run ios, it wasn't seeing Node. And I can't type in that bundler terminal for some reason.

So my solution was in one tab run nvm use 8.9.3 or whatever version you're on, then in that tab run npm start. Then open a new tab and do nvm use 8.9.3 and in that tab run npm run ios or however you run your simulator.

Copy link

@LuckyCrab LuckyCrab commented Apr 16, 2018

This work for me.

react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios' --assets-dest='./ios'
Copy link

@Air-Rands Air-Rands commented Apr 29, 2018

I had the same issue and after trying everything here qyvip's answer lead me to the right one.
In the ios>"Your Main Project Folder">AppDelegate.m .

jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];

to be
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];

Copy link

@miksansegundo miksansegundo commented May 5, 2018

This worked for me. Check that your main.jsbundle is targeted to your main Project.
I also had to clean the caches.

Copy link

@tayfunyasar tayfunyasar commented May 22, 2018

Adding NSAllowsArbitraryLoads: true solved my problem.

@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.