I am setting up react native android for existing project. I followed instruction from Official getting started page. And I am able to open the app in in emulator when I run react-native run-android
. The app is running perfectly.
But the issue is, when I reload it using double clicking R
key, it throws error Could not connect to development server
.
Getting this error on Emulator and real device both
Solutions I have tried:
- Running real device and Macbook on same wifi.
- Setting macbook's IP address & port in Android device/Emulator in
Dev Setting -> Debug server host & port for device
- Running
adb reverse tcp:8081 tcp:8081
Still no luck.
When I open developer option using CMD + D
and clicks on Debug JS Remotely
, it throws different error:
Unable to connect to remote debugger. CLEARTEXT communication to 192.x.x.x not permitted by network security policy.
In some cases it is showing "Connecting to remote debugger", but it is stuck there.