1
votes

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?

2
Check your internet connection is on - Abubakker Moallim

2 Answers

1
votes

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
0
votes

Try adding google() under allProjects and resync:

allprojects {
repositories {
    jcenter()
    mavenCentral()
    google()
}
}

This should resolve the issue.