Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio gradle build failed : could not find bundletools.jar(com.android.tools.build:bundletools:010-alpha01)

I have used a new update of my coworker. and he changed the build.gradle file. But my IDE keeps telling me: Gradle sync failed: Could not find bundletool.jar (com.android.tools.build:bundletool:0.1.0-alpha01). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build/bundletool/0.1.0-alpha01/bundletool-0.1.0-alpha01.jar

and here is my gradle file

repositories {
    maven { url 'https://maven.fabric.io/public' }
    maven { url 'https://maven.google.com' }
    jcenter()
    google()
    mavenCentral()
}
buildscript {
    repositories {
        jcenter()
        google()
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
allprojects {
    repositories {
        jcenter()
        google()
        maven { url "https://jitpack.io" }
        maven { url "https://maven.google.com" }
    }
}

I have tried Setting -> Gradle -> Use default gradle wrapper and unmark Offline work

like image 238
user2582959 Avatar asked May 28 '18 09:05

user2582959


People also ask

Why is my Gradle build failing?

In some cases when your Gradle files are deleted or corrupted you will not be able to download new Gradle files in android studio. In this case, we have to delete the Gradle files which are present already and then again sync your project to download our Gradle files again.

What happens if Gradle sync failed in Android Studio?

Then open Android Studio and go to File > Settings > Build, Execution and Deployment > Gradle > Use Gradle from > Set the path of the downloaded Gradle. Step 4. Now try syncing the Gradle again and check if the error still persists.


1 Answers

The fix is to put google() above jcenter() in your repository list in gradle.

like image 153
Sergio Avatar answered Sep 19 '22 15:09

Sergio