Connect to 127.0.0.1:1080 [/127.0.0.1] failed:


https://www.jianshu.com/p/25ad6d80dc7c

-------------------------------------

Android Studio 常見 Connect to 127.0.0.1:1080 [/127.0.0.1] failed: Connection refused: connect 問題處理

0.152019.02.20 11:15:13字數 173閱讀 4,278

下載資源做sync操作的時候,有時會遇到這種問題:

> 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

相信大家看見這個問題,本能反應就是有本地代理導致 AS 獲取資源的時候遠端服務器訪問不到。不出意外,都會想到需要刪除項目根目錄 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 默認全局配置里去刪除掉代理配置了,對應位置
Windows 在:C:\Users\Administrator.gradle下的gradle.properties中
Mac 在:/Users/.{你的用戶目錄}/.gradle下的gradle.properties中


免責聲明!

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



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