Android Studio Error:Connection refused (Connection refused)

Ming1982 picture Ming1982 · Dec 23, 2017 · Viewed 7.4k times · Source

When I import a project (https://github.com/PhilJay/MPAndroidChart) AndroidStudio shows this error:

Error:Connection refused (Connection refused)

enter image description here

I've tried many things but I haven't been able to fix this error.

I'm using AndroidStudio 3.0 and Gradle 4.1. How can I fix this?

Answer

user2617363 picture user2617363 · Aug 4, 2018

Set proper proxy setting if you use it, or comment out as following in the 'gradle.properties' file:

#systemProp.http.proxyHost=127.0.0.1
#systemProp.https.proxyHost=127.0.0.1
#systemProp.http.proxyPort=1080
#systemProp.https.proxyPort=1080