Skip to content Skip to sidebar Skip to footer

Could Not Find Aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.3.1)

I'm using Android Studio to work with tomahawk-android project, so i cloned the project using git, directly into the Android Studio, where it fails to build, saying; Could not find

Solution 1:

This is due you didn’t put google() as the first repo. The order of google() matters. So just add it abovejcenter() will solve your problem.

See https://stackoverflow.com/a/51151050/8034839

Note that this change should be in your TOP level build.gradle file. E.g.

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google() // first one
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'// NOTE: Do not place your application dependencies here; they belong// in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google() // first one
        jcenter()
    }
}

Note:

Since Android Gradle Plugin (AGP) version 3.0.0 (Gradle version 4.1+), Google introduced its own Google's Maven repositorygoogle(), most of the dependencies were moved to there. So, if you are using the AGP 3.0+, you should refer to this NEW repo firstly.

And here is some explanation about different gradle versions: What is real Android Studio Gradle Version?

Solution 2:

Thanks for @HedeH, who linked me into his answer here, saying:

Try moving the google() method (In all .gradle files) to the top of its execution block.

I did see that answer before while searching for the issue, but i missed that it must be changed "In all .gradle files".

Post a Comment for "Could Not Find Aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.3.1)"