Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.android.tools.build:gradle:3.6.1.
打开build.gradle文件里面的内容显示如下:
-
buildscript {
repositories {
jcenter()
}
dependencies {
classpath ‘com.android.tools.build:gradle:3.3.1’
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
} }allprojects { repositories {
jcenter() } }
解决方法为在 allprojects 字段中增加 google() 源服务器。
修改后的配置变更如下:
- buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath ‘com.android.tools.build:gradle:3.6.1’
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
} } allprojects {
repositories {
google()
jcenter()
} }