Delmontee
Delmontee

Reputation: 2364

cordova gradle 6.0.1 error "Could not find com.android.tools.build:gradle:6.0.1"

I'm trying to locally build my Android app using cordova. I've downloaded the most recent gradle version but on exporting I get this error:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not find com.android.tools.build:gradle:6.0.1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/6.0.1/gradle-6.0.1.pom
       - https://jcenter.bintray.com/com/android/tools/build/gradle/6.0.1/gradle-6.0.1.pom
     Required by:
         project :

Here is the build.gradle buildscript:

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

    dependencies {
        classpath 'com.android.tools.build:gradle:6.0.1'
    }
}

allprojects {
    repositories {
        mavenCentral()
        jcenter()
    }
}

task wrapper(type: Wrapper) {
    gradleVersion = '6.0.1'
}

My gradle-wrapper.properties also states distributionUrl is set to http\://services.gradle.org/distributions/gradle-6.0.1-all.zip

Does anybody know what I'm doing wrong?

Upvotes: 2

Views: 3654

Answers (1)

Gabriele Mariotti
Gabriele Mariotti

Reputation: 363825

Don't confuse gradle with the Android gradle pluing.

The pluing 'com.android.tools.build:gradle:6.0.1' doesn't exist.
The latest stable version of the plugin is: com.android.tools.build:gradle:3.5.2.

Upvotes: 8

Related Questions