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
}

你可能感兴趣的:(android)