之前好好的项目,两个月后运行不起来,之前遇到过的问题没思考一直运行,今天运行项目又浪费了半个多小时,记录一下。
这个问题的原因是架包下载不下来,可以在根build.gradle里加入阿里的镜像仓库和google(),具体如下,添加的六个地方都标注了:
buildscript {
repositories {
//添加1
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url "https://jitpack.io" }
//添加2
google()
//添加3
jcenter()
mavenCentral()
}
}
allprojects {
repositories {
//添加4
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url "https://jitpack.io" }
maven { url 'http://developer.huawei.com/repo' }
//添加5
google()
//添加6
jcenter()
mavenCentral()
}
}