由于这软件是谷歌的,故一些环境下载服务器都在国外,由于国内被墙了,故无法下载。
解决办法:打开build.gradle
添加阿里服务器
[cpp]
maven<span class="token punctuation">{</span> url <span class="token string">'http://maven.aliyun.com/nexus/content/groups/public/'</span><span class="token punctuation">}</span>
[/cpp]
[cpp]
maven<span class="token punctuation">{</span> url<span class="token string">'http://maven.aliyun.com/nexus/content/repositories/jcenter'</span><span class="token punctuation">}</span>
[/cpp]
修改后如下
[cpp]
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
google()
maven{ url'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
<span style="color: #ff0000;">//必须写在JCenter上边</span>
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
maven{ url'http://maven.aliyun.com/nexus/content/repositories/jcenter'}
//必须写在JCenter上边
jcenter()
maven { url "https://jitpack.io" }
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
[/cpp]
评论 (0)