Android CI build: Could not find aapt2-proto.jar

  • A+
Category:Languages

I have failing build on bitbucket CI server:

> Could not resolve all artifacts for configuration ':classpath'.    > Could not find aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.3.1).      Searched in the following locations:          https://jcenter.bintray.com/com/android/tools/build/aapt2-proto/0.3.1/aapt2-proto-0.3.1.jar 

I searched similar questions that suggested google maven repository is missing, but I am not missing it, top level build file:

buildscript {      repositories {         jcenter()         google()     }     dependencies {         classpath 'com.android.tools.build:gradle:3.2.1'         classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'         classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.0'         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin"     } }  allprojects {     repositories {         google()         jcenter()         maven { url "https://jitpack.io" }     } } 

and my app level build file:

buildscript {     repositories {         maven { url 'https://maven.fabric.io/public' }         google()     }      dependencies {         classpath 'io.fabric.tools:gradle:1.26.1'     } } apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'io.fabric'  repositories {     maven { url 'https://maven.fabric.io/public' }     google()     mavenCentral() } 

 


You should try to move the google() method (In all .gradle files) to the top of it's execution block, maybe it's the order of repos it searches in that causes the issue.

So for example, change this:

repositories {   maven { url 'https://maven.fabric.io/public' }   google()   mavenCentral() } 

To this:

repositories {   google()   maven { url 'https://maven.fabric.io/public' }   mavenCentral() } 

If that doesn't help, instead of calling the google() method, try changing it to this:

maven {   url 'https://maven.google.com/'   name 'Google' } 

Comment

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: