Could Not Find Com.android.tools.build:gradle:5.6


Answer :

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.



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
}


Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android SDK Location Should Not Contain Whitespace, As This Cause Problems With NDK Tools