Almost every other time I go through an Android Studio upgrade, my projects no longer compile and I spend an hour or so trying to figure out what was wrong or what I need to change.

Due to this reason very often I will postpone upgrading as much as possible, especially if I have an upcoming application update that I am trying to release on time.

The latest Android Studio upgrade was not an exception. After the upgrade to v. 3.2.1, Gradle failed to compile my project with the following error:

Could not find aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.3.1)

It turns out that it the issue was with the order of the repositories in the build.gradle file. For some reason the google repo had to be moved at the top (above the maven repo), otherwise the appt2-proto library could not be found. Here is how it looks after I fixed it:

repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
Gradle fails after upgrading Android Studio to 3.2.1 with “Could not find aapt2-proto.jar”
Tagged on:     

Leave a Reply

Your email address will not be published. Required fields are marked *

*