Android CI版本:无法找到aapt2-proto.jar
作者:互联网
我在Bitbucket CI服务器上构建失败:
> 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
我搜索了类似的问题,表明Google Maven存储库丢失了,但我并没有错过它.顶级构建文件:
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" }
}
}
和我的应用程序级别构建文件:
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()
}
解决方法:
尝试将google()方法移动到其执行块的顶部.
也许这是它搜索的存储库的顺序导致问题.
例如,改变这个:
repositories {
maven { url 'https://maven.fabric.io/public' }
google() // from here
mavenCentral()
}
对此:
repositories {
google() // to here
maven { url 'https://maven.fabric.io/public' }
mavenCentral()
}
如果这没有帮助,请尝试将其更改为:而不是调用google()方法:
maven {
url 'https://maven.google.com/'
name 'Google'
}
UPDATE
如果上述所有方法都没有帮助 – 请确保您的gradle版本至少为3.0.0:
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
gradle-wrapper版本至少为4.1:
通常位于此处:project_name / gradle / wrapper / gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
标签:android,android-studio,continuous-integration,jcenter 来源: https://codeday.me/bug/20190916/1807372.html