Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 521
Sacha Avatar asked Aug 22 '19 10:08

Sacha


2 Answers

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.

like image 113
Gabriele Mariotti Avatar answered Nov 12 '22 22:11

Gabriele Mariotti


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
}
like image 2
George Avatar answered Nov 12 '22 23:11

George