Android – Could not find com.android.tools.build:gradle:4.0.1

androidandroid-gradle-pluginandroid-studiobuild.gradlegradle

Error :

Could not find com.android.tools.build:gradle:4.0.1.
Searched in the following locations:


build.gradle(Project):

 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

#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.

I just migrated from android studio 2.3.3 to 4.0.1 .

what is my problem????
tell me if you need more information .

thank you for your answer 🙂

Best 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