ruman hassan
ruman hassan

Reputation: 59

React Native: Unable to download JS bundle from the Dev Server

I am trying to run basic AwesomeProject app that react native have by default, on Windows 7 machine through Genymotion. The Virtual Devices that i have tried is Nexus 7 4.2.2 and Nexus 6 5.1.0.

I am using Nodejs (4.3.0)

I followed below steps to overcome JS bundle issue, but still no success:

Moreover, I have seen another solution on React.js official docs, i.e executing this command "adb reverse tcp:8081 tcp:8081" and then starting the server and updating the IP-address and port respectively. But this solution is useful if i test the app on my personal device rather than emulator.

Any suggestion or alternate solution is really appreciated.

Thanks.

Upvotes: 2

Views: 3224

Answers (4)

Rico Humme
Rico Humme

Reputation: 476

The problem I encountered was that my port 8081 was already in use by another process and therefor my react native process wouldn't start.

using lsof -n -i4TCP:8081 | grep LISTEN pointed me in the correct direction

Upvotes: 0

Ahmad Khudeish
Ahmad Khudeish

Reputation: 1137

I had this issue when I was running the react native packager while connected to my work VPN once I disconnected my work VPN connection the packager was able to pick up the correct IP interface for my app.

Upvotes: 0

Fida
Fida

Reputation: 1358

OK!!

First of All you need to do react-native start.

When Application deployed on device, you can tap the Menu button or shake your Cell to load the Menu, Most modern phone dont have the menu button. When it Loads Find Dev Settings. In the Debugging below, Click Debug Server host and port for device Put your System Local Network IP assigned to you by DHCP. You can do ifconfig on ubuntu to see your IP.

Put your IP address like this 192.168.x.x:8081 Do a reload JS.

You will be all up and set. :)

Important : Make sure that your Phone and System is on Same WIFI.

Upvotes: 1

ajack
ajack

Reputation: 586

Start the packager:

react-native start

Go to this url in your browser

http://localhost:8081/index.android.bundle?platform=android

Once that loads it should give a better error response than the one you have.

Upvotes: 0

Related Questions