1. 程式人生 > >Gradle之Could not find com.android.tools.buildgradle3.0.0. Searched in the followi

Gradle之Could not find com.android.tools.buildgradle3.0.0. Searched in the followi

Could not find com.android.tools.buildgradle3.0.0. Searched

解決辦法:這是因為在gradle中的repositories 缺少了 ‘google() ‘程式碼

buildscript {
    repositories {
        google() //在程式碼中增加該行即可
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files } } allprojects { repositories { google() //同上 jcenter() maven { url "file://$sdkDir/extras/android/m2repository/" } } version = rootProject.ext.serviceVersion group = rootProject.ext.group
}