Could not resolve all files for configuration ':classpath'.Could not find com.android.tools.
阿新 • • 發佈:2018-11-01
升級到Android Sutido 3.0後,跑測之前的Model的main()方法方法時報錯:
Error:Gradle: A problem occurred configuring root project ‘MyApplication’.
Could not resolve all files for configuration ‘:classpath’.
Could not find com.android.tools.build:gradle:3.0.0.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.jar
Required by:
project :
1
2
3
4
5
6
7
8
解決:
修改Project的build.gradle(注意:不是App的build.gradle),兩處加上google()
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath ‘com.android.tools.build:gradle:3.0.0’
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}