项目场景:
提示:这里简述项目相关背景:
项目在构建的时候,可能会遇到旧项目里面的配置不能正常使用
问题描述
提示:这里描述项目中遇到的问题:
Could not find com.android.tools.build:gradle:4.1.2.
意思是:无法找到gradle:4.1.2
的版本
原因分析:
提示:这里填写问题的分析:
出现这种情况,有可能是因为网络的问题,毕竟gradle官网是在国外,网速差的话可能就下载不下来
解决方案:
提示:这里填写该问题的具体解决方案:
1.1.打开build.gradle (Project)
2.添加国内的阿里云
buildscript {
repositories {
google()
jcenter()
maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
}
}