6

I was trying to setup react native for android. When I finally try to run the application, with react-native run-android, I get a message JS server not recognized, continuing with build.... The build is completed successfully and installed on the emulator. But since there is no JS server, I get the red screen that says Unable to download JS bundle.

Jophin Joseph
  • 2,864
  • 4
  • 27
  • 40

1 Answers1

4

This message means you have another service listening on port 8081, so the JS packager can't be started. You can find what process is blocking the port by running:

lsof -n -i4TCP:8081 | grep LISTEN

You can stop/kill this process and then run react-native run-android again.

Felix
  • 88,392
  • 43
  • 149
  • 167
  • There is no process listening on 8081. I'm still getting the error. – Jophin Joseph Sep 30 '15 at 10:01
  • @JophinJoseph did you run the `lsof` command? Are you getting the exact same error (`JS server not recognized`)? – Felix Sep 30 '15 at 10:02
  • I ran lsof. It returned no results. When I start to run the app with `react-native run-android`, I get the warning `[warn] JS server not recognized, continuing with build...`. The build is successful, but in the emulator, I get a red screen that says `Unable to download JS bundle` – Jophin Joseph Sep 30 '15 at 10:04
  • It gives 403 Forbidden – Jophin Joseph Sep 30 '15 at 10:14
  • It looks like you have *something* running on that port then, that is not the packager. What OS are you on? – Felix Sep 30 '15 at 10:15
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/90977/discussion-between-felix-and-jophin-joseph). – Felix Sep 30 '15 at 10:19
  • 2
    How to run this command(lsof -n -i4TCP:8081 | grep LISTEN) on window machine .....? – coder Sep 29 '16 at 04:55