AS报错“Could not find com.android.tools.build:gradle:4.1.2.”的解决办法

1.打开build.gradle (Project:Notes-master)

2.将其中内容替换为如下代码(使用阿里云镜像)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
google()
jcenter()
maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
}

dependencies {
    classpath 'com.android.tools.build:gradle:4.1.2'
}

}

allprojects {
repositories {
google()
jcenter()
maven { url "http://maven.aliyun.com/nexus/content/groups/public/" }
}
}


3.点击Sync Now 同步gradle,稍等便可

至此,问题解决


已发布

分类

来自

标签: