Gradle Sync Failed: Could Not Find Com.android.tools.build:gradle:5.5.1
Solution 1:
This dependency corresponds to the Android gradle plugin, not Gradle itself. Typically, the Android gradle plugin should match the version number of your Android Studio installation (e.g. "3.4.2").
If you want to update Gradle itself, and you are using the gradle wrapper, update the gradle/wrapper/gradle-wrapper.properties
file and edit the distributionUrl
line:
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-all.zip
If you are using a local distribution, then you don't have to do anything. Your project will be built using the gradle distribution set in the Android Studio settings (in your case, Gradle 5.5.1).
Edit: It seems that your build.gradle file is also missing the google()
repositories, here is what it should look like if you want to use the Android gradle plugin 3.4.2:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
Solution 2:
From mavnrepository.com Google tab, latest stable version:
implementation group: 'com.android.tools.build', name: 'gradle', version: '3.4.2'
Latest alpha:
implementation group: 'com.android.tools.build', name: 'gradle', version: '3.6.0-alpha04'
Note: Only use the Android Gradle Plugin that matches your AS version. For example, you are using AS 3.4.2, so use the Android Gradle Plugin 3.4.2
Solution 3:
Go to Android Studio menu, Preferences > Build Execution and Deployment > Build > Gradle and select "'gradle.wrapper.properties' file" in the "Use Gradle From:" menu.
Select your gradle version and plugin version from here:
https://developer.android.com/studio/releases/gradle-plugin#updating-gradle
Set the gradle version in the top build.gradle file.
dependencies {
classpath 'com.android.tools.build:gradle:4.2.0'
}
Set the plugin version in the gradle.wrapper.properties file, for example:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
Sync Gradle and Build.
Solution 4:
I had same issue with gradle 7.0.2
Adding google()
under jcenter()
in build.gradle
file worked for me
Something like this
// 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:7.0.2'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
Post a Comment for "Gradle Sync Failed: Could Not Find Com.android.tools.build:gradle:5.5.1"