Could not resolve all files for configuration ‘:classpath’.Could not find com.android.tools.

  • Post author:
  • Post category:其他


升级到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 :

解决:

修改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
}



版权声明:本文为monkin2011原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。