2016-08-23 115 views
1

我在Android Studio上添加volley時遇到問題。 在Android Studio`添加volley後,當我同步的項目的gradle它說:在Android Studio上添加齊射後Gradle同步失敗

Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle. 

gradle sync failed: Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle. 

Consult IDE log for more details (Help | Show Log) 

我嘗試下面的方法:HTTP設置在gradle.properties

systemProp.http.proxyHost=www.somehost.org 
systemProp.http.proxyPort=8080 
systemProp.http.proxyUser=userid 
systemProp.http.proxyPassword=password 
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost 

,但沒有奏效。

回答

0

嘗試使緩存無效並重新啓動

轉到File-> Invalidate Caches/Restart->選擇「Invalidate and Restart」。

0
  1. 確保您的機器已連接到互聯網。
  2. 轉到文件 - >設置 &擴大建立,執行,部署 - >搖籃 - >取消選中脫機工作 - >確定
  3. 禁用所有代理設置你的項目&也從gradle.properties刪除代理http設置
  4. 轉到文件 - >點擊的Invalidate緩存/重啓 - >的Invalidate &重啓