2016-08-23 118 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 &重启