Connection refused when running android project
See original GitHub issueEnvironment
OS: Windows 7 Node: 8.11.1 Yarn: Not Found npm: 5.6.0 Watchman: Not Found Xcode: N/A Android Studio: Not Found
Packages: (wanted => installed) react: 16.3.1 => 16.3.1 react-native: 0.55.4 => 0.55.4
Description
Connection refused while running react-native run-android
Steps to Reproduce
react-native run-android
Expected Behavior
Build success
Actual Behavior
[DeviceMonitor]: Unable to open connection to: localhost/xx.xxx.xxx.xx:5037, due to: java.net.ConnectException: Connection refused: connect [DeviceMonitor]: Connection attempts: 1 [DeviceMonitor]: Unable to open connection to: localhost/xx.xxx.xxx.xx:5037, due to: java.net.ConnectException: Connection refused: connect [DeviceMonitor]: Connection attempts: 2
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top Results From Across the Web
Android Studio - Connection refused: connect - Stack Overflow
1 Answer 1 · Back to Android Studio > File > Settings > HTTP Proxy > Set Manual proxy configuration to credentials from...
Read more >Android device connection refused in WebClient download ...
The mobile app is using the Ip address of the PC and a number of ports have been tried yielding the same response....
Read more >Connection Refused Error On My Wife's Phone - Works On Mine
I recently installed the Home Assistant app on my Android phone Pixel 4 XL. I went through the Duck DNS and HTTPS setup...
Read more >How to Fix the SSH "Connection Refused" Error - Kinsta
1. Your SSH Service Is Down ... In order to connect to your server with SSH, it must be running an SSH daemon...
Read more >Set up Android Emulator networking
Communication with the emulated device may be blocked by another (physical) firewall or router where your machine is connected. The emulator's ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
cd your project file and paste it to terminal for mac:
export _JAVA_OPTIONS=-Djava.net.preferIPv4Stack=true
It’s due to fact that Win7 prefers to return IPV6 address for localhost and mine was not properly setup. So I forced java to use IPV4 adress by adding a new environment variable :
_JAVA_OPTIONS=-Djava.net.preferIPv4Stack=true
And it fixed it.