9

I understand that this has been asked many times before but none of the solutions work for me. Here is the screen grab of my device(android 6.0.1 samsung J210F): enter image description here

When I open localhost:8081/debugger-ui I get this message: enter image description here

So debugger is running on 8081. BUT it gives this message on console: enter image description here

The reverse tcp command has already been executed by the debugger: enter image description here

(The full error that got clipped was Error running 'RN': timeout on waiting for connection to React Native packager. Make sure you have selected 'Debug JS Remotely' from the Developer Menu. I have already selected "Debug JS Remotely" from developer menu so I don't think thats the reason.

I hope I provided all the information. Have been struggling for hours to solve this.

Community
  • 1
  • 1
rahulserver
  • 10,411
  • 24
  • 90
  • 164
  • Only a short hint for something I learned the hard way: Always use "Incognito - Mode" in Chrome-Browser. Because Chrome merge the sourcecode of the page with all activated and loaded Browser-Extensions. This may give you a huge noise in the console, which caused by your Browser-Extensions, and not by your app. – suther Apr 17 '18 at 13:17

4 Answers4

10

Just run the command adb reverse tcp:8081 tcp:8081 and then run react-native run-android. The problem would be solved.

kamal11
  • 364
  • 1
  • 5
  • 16
4

Before enabling remote debugging on your emulator, open http://localhost:8081/debugger-ui in chrome. Then enable remote debugging and go back to the chrome page where you should see your console logs.

Reference

Vijay Vavdiya
  • 1,249
  • 13
  • 17
2

Just incase anyone comes across this, I ran into this problem and none of the above solutions worked for me.

I was building my app to my pixel 2 and trying to get chrome debugging working and kept getting this error.

What worked for me: Shake your phone to pull up the RN menu. Click on dev settings. Inside dev settings, click on 'Debug server host & port for device'

here make sure its your machine ip address followed by port 8081. If youre on a mac, you can find your machine ip by going to system preferences --> network --> and under 'status: connected' you will see the IP address info. Make sure your device and mac are on the same wifi network.

Going back to 'Debug server host & port for device' input '10.0.1.1:8081' (replace 10.0.1.1 with whatever your machine ip was).

Reload your build, and then click Debug JS remotely. These steps worked for me.

MaxPower
  • 367
  • 2
  • 12
0

If you are trying it on your own device, shake your phone left and right to open the debugger menu. then the error goes away.