简体   繁体   English

找不到 com.android.tools.build:gradle:4.0.1

[英]Could not find com.android.tools.build:gradle:4.0.1

Error:错误:

Could not find com.android.tools.build:gradle:4.0.1.找不到 com.android.tools.build:gradle:4.0.1。 Searched in the following locations:在以下位置搜索:


build.gradle(Project): build.gradle(项目):

 buildscript {
repositories {
    jcenter()
    google()
}
dependencies {

    classpath "com.android.tools.build:gradle:4.0.1"

   
}


}



 allprojects {
repositories {
    jcenter()
    maven {
        url 'https://jitpack.io'
    }
    google()
}

}



task clean(type: Delete) {
delete rootProject.buildDir
}

gradle-wrapper.properties gradle-wrapper.properties

#Mon Jul 27 15:16:19 IRDT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip

looks like google() and jcenter() are not working as expected.看起来 google() 和 jcenter() 没有按预期工作。

I just migrated from android studio 2.3.3 to 4.0.1.我刚刚从 android studio 2.3.3 迁移到 4.0.1。

what is my problem????我的问题是什么??? tell me if you need more information.告诉我您是否需要更多信息。

thank you for your answer:)谢谢您的回答:)

SOLVED!解决了!

I had this problem for days and i solved that finally.我有这个问题好几天了,我终于解决了。 check my answer here:在这里查看我的答案:

Could not find com.android.tools.build:gradle:4.0.1 OR 4.0.0 OR any versions 找不到 com.android.tools.build:gradle:4.0.1 OR 4.0.0 或任何版本

Try to put the google() as the first one in the repositories list in the gradle file to solve this issue.尝试将 google() 作为 gradle 文件的存储库列表中的第一个来解决此问题。

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

allprojects {
    repositories {
        google()
        jcenter()
    }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM