Android Studio錯誤:Connect to 127.0.0.1:1080 [/127.0.0.1] failed: Connection refused: connect


同步gradle時發生如下錯誤:

> 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個地方都存在以下內容,視自己情況而定)

看到很多博客說刪除掉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里的代理內容,但還是報上面的錯誤

原因:還需要刪除掉C:\Users\Administrator\.gradle下的gradle.properties中的代理

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM