
遇到这种错误提示“Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle.”

除了去检测一下gradle配置相关以外,


还有就是SDK Location的配置信息一定要对。


如果这些都不行,那很明显就是你的build.gradle的 repositories信息配置没有采用国内镜像下载失败。你可以直接添加如下:

切记是
buildscript跟allprojects的repositories都要配置:
maven{ url 'https://maven.aliyun.com/repository/public' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/'}
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven { url 'https://dl.google.com/dl/android/maven2/' }
maven { url "https://www.jitpack.io" }
再编译一下就ok了
本文讲述了在Android开发过程中遇到Connectiontimedout错误时,如何检查并解决Gradle配置问题,重点提到了检查SDKLocation设置和在国内使用阿里云镜像替换默认仓库以避免下载失败。
2369

被折叠的 条评论
为什么被折叠?



