I have a problem running apps in Android Studio. When I press Run, the "Select Deployment Target" dialog popup occurs, but I am never able to see any emulators or devices occur. The event log prints out the following and repeats indefinitely:
5/6/18
12:40 PM Gradle sync started
12:40 PM Project setup started
12:41 PM Gradle sync finished in 49s 932ms
12:41 PM Executing tasks: [:app:generateDebugSources]
12:41 PM Gradle build finished in 15s 765ms
12:44 PM Unable to open connection to: localhost/0.0.0.0:5037, due to: java.net.ConnectException: Connection refused
12:44 PM Connection attempts: 1
12:44 PM Unable to open connection to: localhost/0.0.0.0:5037, due to: java.net.ConnectException: Connection refused
12:44 PM Connection attempts: 2
12:44 PM Unable to open connection to: localhost/0.0.0.0:5037, due to: java.net.ConnectException: Connection refused
12:44 PM Connection attempts: 3
12:44 PM Unable to open connection to: localhost/0.0.0.0:5037, due to: java.net.ConnectException: Connection refused
12:44 PM Connection attempts: 4
12:44 PM Unable to open connection to: localhost/0.0.0.0:5037, due to: java.net.ConnectException: Connection refused
12:44 PM Connection attempts: 5
I am able to run react-native projects using the command line, but when using Android Studio directly, this occurs.
I have tried creating new projects in Android Studio and still have the same results. I believe this started to happen once I updated from Android Studio 3.0 to 3.1.
Any ideas to fix this issue or get more information?
Thanks.
System Information:
MacOS High Sierra 10.3.14 Macbook Pro (Late 2011)
Software Information:
Android Studio 3.1.2 Java 9.0.4
I had the same issue, i fixed it by removing 0.0.0.0
mapping in /etc/hosts
.
Earlier i had a mapping 0.0.0.0 localhost
in /etc/hosts
file.
I also had a similar issue on Mac and fixed it by appending the line 127.0.0.1 localhost to /etc/hosts
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With