0
点赞
收藏
分享

微信扫一扫

Gradle升级,Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure


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

下载Gradle失败,主要是速度太慢


一、如果是打开别人的项目报这个错

解决办法:

1.打开gradle-wrapper.properties文件

Gradle升级,Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure_android


2.直接看最后一行,后面是版本号,改成你已经下载好的版本,或者改为可以运行项目的版本

Gradle升级,Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure_版本号_02


3.打开项目根目录下的build.gradle,修改对应的classpath

Gradle升级,Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure_android_03


然后Try Again就ok了,或者Tools > Android > Sync Project with Gradle Files


Gradle版本对照关系

Gradle升级,Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure_android_04

链接:​​https://developer.android.google.cn/studio/releases/gradle-plugin.html#updating-gradle​​


二、升级Gradle

目前Gradle最新的版本是2017.7.26发布的4.0.2

Gradle升级,Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure_android_05

链接:​​http://services.gradle.org/distributions/​​,选一个版本,用浏览器自带或者迅雷下载下来,会用到


1.改gradle-wrapper.properties文件中的版本号

Gradle升级,Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure_版本号_06


2.改了之后Try Again或者build,会一直Refreshing,虽然下载不下来,但是会在本地生产文件夹

Gradle升级,Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure_Gradle升级_07

会生成改的版本号的文件夹,里面有一个随机命名的文件夹

Gradle升级,Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure_Gradle升级_08

并有两个文件

Gradle升级,Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure_Gradle升级_09

然后把之前下载好的zip包拷进来


3.关闭AS、重启AS或者Tools > Android > Sync Project with Gradle Files


大概意思:AS下载太慢导致下载失败或下载超时,自己去帮AS下载,然后给AS用。。



举报

相关推荐

0 条评论