Android Studio錯誤:Connect to 127.0.0.1:1080 [/127.0.0.1] failed: Connection refused: connect?
同步gradle時發(fā)生如下錯誤:
> Could not resolve all dependencies for?configuration ':classpath'.
> Could not resolve com.github.dcendents:android-maven-gradle-plugin:1.3.
Required by:
project :
> Could not resolve com.github.dcendents:android-maven-gradle-plugin:1.3.
> Could not get resource 'https://jcenter.bintray.com/com/github/dcendents/android-maven-gradle-plugin/1.3/android-maven-gradle-plugin-1.3.pom'.
> Could not GET 'https://jcenter.bintray.com/com/github/dcendents/android-maven-gradle-plugin/1.3/android-maven-gradle-plugin-1.3.pom'.
> Connect to 127.0.0.1:1080?[/127.0.0.1] failed: Connection refused: connect
原因:gradle.properties 文件中使用了代理
有2個地方需要修改(如果2個地方都存在以下內(nèi)容,視自己情況而定)
看到很多博客說刪除掉gradle.properties中的代理
systemProp.https.proxyPort=1080
systemProp.http.proxyHost=127.0.0.1
systemProp.https.proxyHost=127.0.0.1
systemProp.http.proxyPort=1080
我刪除工程中gradle.properties里的代理內(nèi)容饮亏,但還是報上面的錯誤
原因:還需要刪除掉C:\Users\Administrator\.gradle下的gradle.properties中的代理