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

先看報錯信息:

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 :* Try:Run with –stacktrace option to get the stack trace. Run with –debug option to get more log output.

就是找不到這裏兩個文件

網上有很多解決方法,當對我的問題卻沒有解決了

先看看第一種:

把google()去掉

buildscript {
    apply from:'version.gradle'
    ext.kotlin_version = '1.3.21'
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

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

添加如下:

maven { url 'https://maven.google.com' }

但沒有作用,大家可以試一試:

我的方法是在setting裏面取消一個選項:stroe generated project files externally在外部存儲生成的項目文件

之前是√上的,去掉之後再試下就ok了!!1,這也花了很久時間,可能每個問題不一樣,但最後都是糊里糊塗就解決了的

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章