4
Could not find com.android.tools.build:gradle:4.0.1.
Searched in the following locations:
  - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.0.1/gradle-4.0.1.pom
  - https://jcenter.bintray.com/com/android/tools/build/gradle/4.0.1/gradle-4.0.1.pom
Required by:
    project :
Open File

that is the error log. I searched in many websites and all I got was to add google() in build.gradle file witch android studio has already done it.

I tried mavenCentral() too but that error still exist. I installed AS 3.1 then I upgraded it to 4.0.1 which is the latest stable version.

the build.gradle file

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.0.1"

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

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

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

Edited: I can download https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.0.1/gradle-4.0.1.pom manually but anyone knows where to copy and paste it?

1 Answers1

0

I had the same problem for days and i solved that yesterday. check my answer here : Could not find com.android.tools.build:gradle:4.0.1 OR 4.0.0 OR any versions

Sadegh J
  • 1,603
  • 2
  • 9
  • 22