- 由于Android Studio有的依赖包国内访问不了,设置不了代理,后来在Android Studio 3.3,一直提示“Cause: jcenter.bintray.com:443 failed to respond”,后来搜索到网上说可能是代理的原因,在“C:\Users\Administrator.gradle\gradle.properties",把systemProp.https.proxyPort和systemProp.https.proxyHost的代理注销了或者把文件gradle.properties删除,就正常了。
2.在项目project的build.gradle下配置成阿里的镜像服务器
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
这里贴出build.gradle全部的代码
buildscript {
repositories {
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
}
}
allprojects {
repositories {
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
jcenter()
google()
}
}
配置后重新运行gradle,Android Studio会优先从阿里的镜像服务器拉取相应资源。
作者:weixin_33953384
来源:CSDN
原文:https://blog.csdn.net/weixin_33953384/article/details/87413971
版权声明:本文为博主原创文章,转载请附上博文链接!