0

I am writing an app and just last night I wanted to try it on my device. So, I enabled USB debugging on my device, connected it to my machine and issued

react-native run-android

This installed and run my app on device just as expected. All good...

But, this morning, I tried opening the same app I installed last night as explained above, by finding the app on my device and tapping on it. I get error "Hot loading isn't working because it cannot connect to the development server."

enter image description here

OK, I disabled hot reloading on my device and run app again. This time app showed on device without error but my app should show one image from my resource folder and it is not although it was showing it last night.

So, I shaked device to show dev menu and tap on Reload to reload my app and then I get error "Could not connect to development server."

enter image description here

Why am I getting these errors out of a sudden?

The only difference btw me running my app last night and this morning is that last night, I had enabled USB debugging, was connected to my laptop through USB cable, and was starting the app through the terminal.

That deployed my app to device and from that point, I would expect that once the app is deployed, it does not care any more about whether packager is running or USB debugging is enabled. It should just run.

pixel
  • 9,653
  • 16
  • 82
  • 149
  • Have you tried to execute "$ adb reverse tcp:8081 tcp:8081"? https://facebook.github.io/react-native/docs/running-on-device.html#3-run-your-app – carlosvin Feb 05 '18 at 19:13
  • 1
    Yes, I read it too fast. I think problem here is that application was started first time using devserver, so each time you re-open it it keeps trying to connect. But if you kill application and start it again I think it should work as you expected – carlosvin Feb 05 '18 at 19:39
  • Yes, that is what I meant – carlosvin Feb 05 '18 at 19:43
  • killed it multiple times, but no solution. Thanks – pixel Feb 05 '18 at 20:44

0 Answers0