Android studio 4.0 加载gradle错误
先在build.gradle中加入阿里云
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
maven { url ‘https://maven.aliyun.com/repository/public’ }
maven { url ‘https://maven.aliyun.com/repository/google’ }
maven { url ‘https://maven.aliyun.com/repository/jcenter’ }
google()
jcenter()
}
dependencies {
classpath “com.android.tools.build:gradle:4.0.1”
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
/lintOptions {
// true 所有正式版构建执行规则生成崩溃的lint检查,如果有崩溃问题将停止构建
checkReleaseBuilds false
//true 错误发生后停止构建
abortOnError false
}/
allprojects {
repositories {
maven { url ‘https://maven.aliyun.com/repository/public’ }
maven { url ‘https://maven.aliyun.com/repository/google’ }
maven { url ‘https://maven.aliyun.com/repository/jcenter’ }
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
如果还是报错可以尝试更改setting中更改gradle的地址
特别感谢https://blog.csdn.net/da_caoyuan/article/details/104343058
群主给了指导
上一篇: SpringBoot文件上传下载
推荐阅读
-
详解关于Android Studio中安装和gradle的一些坑
-
Android studio报: java.lang.ExceptionInInitializerError 错误
-
Android studio怎么这是代码检查错误警报?
-
Android Studio中的Gradle依赖深入讲解
-
Android Studio gradle插件版本和gradle版本对应关系
-
android studio怎么添加.so文件?android studio加载so文件的方法
-
[build.gradle配置系列(一)]android studio根据版本号动态生成apk名
-
解决android studio 3.0 加载项目过慢问题--maven仓库选择
-
Android获取WebView加载url的请求错误码 【推荐】
-
android studio 一直卡在Gradle:Build Running的几种解决办法