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
Connection refused while running react-native run-android
react-native run-android
Build success
to: java.net.ConnectException: Connection refused: connect
to: java.net.ConnectException: Connection refused: connect
It looks like your issue may be missing some necessary information. Can you run react-native info and edit your issue to include these results under the Environment section?
Any solution for this issue?
Any solution on this? im having the same problem, I suspect it was something to do with realm? since the port is 5037 and im seeing this piece of message when react-native run-android.
Task :realm:forwardDebugPort
- daemon not running; starting now at tcp:5037
- daemon started successfully
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.
i have same issue.
i use macOS High Sierra 10.13.6 and react-native version: 0.57.7
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=trueAnd it fixed it.
in what file?
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.in what file?
cd your project file and paste it to terminal
for mac: export _JAVA_OPTIONS=-Djava.net.preferIPv4Stack=true
Thank you @minhphung210
Most helpful comment
cd your project file and paste it to terminal
for mac:
export _JAVA_OPTIONS=-Djava.net.preferIPv4Stack=true