1. 程式人生 > >Could not find com.android.tools.build:gradle:3.0.0.

Could not find com.android.tools.build:gradle:3.0.0.

android studio升級3.0,gradle升級4.1以後專案報錯,如下

解決方法:在project的builde.gradle做如下操作分別加上google()

buildscript {

repositories {
    google()
    ....
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0'


    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
}

allprojects {
    repositories {
        google()
        .....
    }
}