Sacha
Sacha

Reputation: 133

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

I have a problem with my gradle, i have try many solution that i have found on stackoverflow and other documentation but it still doesn't work, please help me

enter image description here

enter image description here

Upvotes: 11

Views: 15339

Answers (2)

George
George

Reputation: 2997

There is currently no version 5.6 for the Gradle plugin version. The link below lists all the latest releases for the Gradle plugin versions on Google's Marvel repository.

https://mvnrepository.com/artifact/com.android.tools.build/gradle?repo=google

I think what you mean is the distributionUrl version in your Gradle wrapper properties:

Go to your gradle-wrapper.properties file and complete as required:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6-all.zip

Then your build.gradle file for the project will be as follows:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript
        {
    repositories
            {
        google()
        jcenter()
    }

    dependencies
            {
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:4.2.0'
        classpath 'com.android.tools.build:gradle:3.4.2'
    }
}


allprojects {

    repositories {
        google()
        maven { url 'https://maven.google.com' }
        jcenter()
    }

}

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

Upvotes: 2

Gabriele Mariotti
Gabriele Mariotti

Reputation: 363439

Don't confuse gradle with the Android Gradle plugin.

classpath 'com.android.tools.build:gradle:5.6'

It is the Android Gradle plugin and 5.6 doesn't exist.

Use the latest stable release:

classpath 'com.android.tools.build:gradle:3.5.0'

Check the release notes for other versions.

To change the gradle version, edit the file gradle/wrapper/gradle-wrapper.properties

distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

More info in official doc.

Upvotes: 31

Related Questions