Ming1982
Ming1982

Reputation: 11

Android Studio Error:Connection refused (Connection refused)

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?

Upvotes: 1

Views: 11136

Answers (2)

user2617363
user2617363

Reputation: 61

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

Upvotes: 3

Avijeet Dutta
Avijeet Dutta

Reputation: 559

Try adding google() under allProjects and resync:

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

This should resolve the issue.

Upvotes: 0

Related Questions