0

facing this error if I Reload or Debug JS Remotely. I tried all possible solutions mentioned in this SO question, But there was no use.

I have uninstalled and reinstalled the app, deleted node modules folder and then recreated, deleted total project and created new one. But nothing worked for me. As some one suggested in the above mentioned link, I tired to disable the firewall.it didn't work.Surprisingly it happened all of sudden. The only thing that I didn't tried formatting the system completely.

targetSdkVersion 26
Machine OS is Ubuntu
Developing for Android mobiles
react-native: 0.52.2
Using Chrome browser for debugging

tried in multiple mobiles and tablets, But same error is occurring. At the moment the only possible way to re-run the app is running react-native run-android every time code changes.

Could somebody help me to get rid of this error?

Thank You.

ThinkAndCode
  • 1,319
  • 3
  • 29
  • 60
  • it is hard to identify your problem without further info, just try this if u haven't yet, while the server is still running, run -npm install then -react-native run-android – Ahmed Imam Feb 21 '19 at 07:54
  • @AhmedImam This solution didn't work. Can you let me know what further information do you required? – ThinkAndCode Feb 21 '19 at 08:39
  • Environment, Target android version and Development OS. be more specific about the issue so the developers will be in better position to answer your question, – Ahmed Imam Feb 21 '19 at 08:50
  • 1
    btw is the packager running ? when u run react-native run-android. – Ahmed Imam Feb 21 '19 at 08:51
  • @AhmedImam Yes, It was. I have update my question with specific details. Could you have a look at it? – ThinkAndCode Feb 21 '19 at 09:14
  • 1
    Have you tried running 'adb reverse tcp:8081 tcp:8081' when the debugger shows the 'cannot connect...' message? – Karan Modi Feb 21 '19 at 09:33
  • @Karan Modi You just nailed it Man.It worked for me. Could you let me know where could be the issue and what this command is doing? – ThinkAndCode Feb 21 '19 at 10:25
  • Glad it worked for you, its setting up the port between your device and the computer. for more info read https://www.reddit.com/r/reactnative/comments/5etpqw/what_do_you_call_what_adb_reverse_is_doing/ – Ahmed Imam Feb 21 '19 at 10:46
  • @KaranModi It's working fine when mobile is connected through USB cable, But not working when connected Via Wifi. Any suggestion for this? – ThinkAndCode Feb 21 '19 at 11:02
  • @AhmedImam It's working fine when mobile is connected through USB cable, But not working when connected Via Wifi. Any suggestion for this? – ThinkAndCode Feb 21 '19 at 11:03
  • @Kishore You can also connect to the development server over Wi-Fi. You'll first need to install the app on your device using a USB cable, but once that has been done you can debug wirelessly by following these instructions. http://facebook.github.io/react-native/docs/running-on-device.html#method-2-connect-via-wi-fi – Ahmed Imam Feb 21 '19 at 11:35
  • @Kishore it tells your system to listen for incoming requests from port 8081 to port 8081 over adb using tcp. The development server then responds when you send a 'reload' request from your device. – Karan Modi Feb 21 '19 at 14:18
  • @KaranModi If that is the case, How come it was working fine all these days without running this command and what might have happened all of sudden? – ThinkAndCode Feb 22 '19 at 03:49
  • @AhmedImam I have been following same procedure for many months and there hasn't been any issue. But all of sudden it's not working now. Is there any command for this issue also like `adb reverse tcp:8081 tcp:8081` – ThinkAndCode Feb 22 '19 at 03:54

0 Answers0