我从jenkins构建失败,我的错误是:
失败:构建失败,并出现异常。
出了什么问题: 任务':app:mergeDebugResources'的执行失败。 java.util.concurrent.ExecutionException:com.android.builder.internal.aapt.v2.Aapt2Exception:Android资源编译失败 输出:C:\ Windows \ System32 \ config \ systemprofile.gradle \ caches \ transforms-1 \ files-1.1 \ appcompat-v7-28.0.0.aar \ 469a8bd93b2c9fb2a42463f1ac0d81a5 \ res \ layout \ abc_action_bar_up_container.xml:错误:找不到文件。
命令:C:\ Windows \ System32 \ config \ systemprofile.gradle \ caches \ transforms-1 \ files-1.1 \ aapt2-3.2.1-4818971-windows.jar \ 0b5860598e9c67615c35754aea535df6 \ aapt2-3.2.1-4818971-windows \ aapt2 .exe编译-旧版\ -o \ C:\ Users \ ArPa \ Documents \ app \ build \ intermediates \ res \ merged \ debug \ C:\ Windows \ System32 \ config \ systemprofile.gradle \ caches \ transforms-1 \ files-1.1 \ appcompat-v7-28.0.0.aar \ 469a8bd93b2c9fb2a42463f1ac0d81a5 \ res \ layout \ abc_action_bar_up_container.xml 守护程序:AAPT2 aapt2-3.2.1-4818971-windows守护程序#2
我的build.gradle
buildscript {
repositories {
maven {
url 'https://maven.google.com'
}
jcenter()
google()
maven { url 'https://maven.fabric.io/public' }
}
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 {
jcenter()
maven {
url 'https://maven.google.com'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我的gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
我该怎么办? 预先谢谢你!
答案 0 :(得分:0)
AAPT2的最后一个错误是Windows路径较长-最近已修复,应在android gradle插件3.4 beta 1或3.5 alpha 2中可用。一旦它们退出,升级到这些版本应该摆脱此错误。 在他们出局之前(应该很快),您可以做两件事: