【发布时间】:2017-11-22 09:11:20
【问题描述】:
这是我的 build.gradle (Module:app) 文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
defaultConfig {
applicationId "com.doctor.ciao"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.felipecsl:gifimageview:2.1.0'
compile 'com.github.devlight.pulseview:library:1.0.2'
compile 'commons-io:commons-io:2.4'
compile 'com.github.lguipeng:BubbleView:1.0.1'
}
我收到两个错误:
错误:java.util.concurrent.ExecutionException:com.android.tools.aapt2.Aapt2Exception:AAPT 错误
-
错误:任务 ':app:mergeDebugResources' 执行失败。
错误:java.util.concurrent.ExecutionException:com.android.tools.aapt2.Aapt2Exception:AAPT 错误
我已经在 gradle.properties 文件中添加了"android.enableAapt2=false",但错误仍然存在。请帮我解决这个问题。谢谢
【问题讨论】:
-
打开 Gradle 控制台(右下)并找到完整的错误描述。
-
谢谢。我发现了确切的问题并修复了它。
-
太棒了!您可以更新您的问题并发布答案,以便其他人发现它有帮助。
-
我的可绘制文件夹中的一些图像被自动重命名为“imagename.9.png”。所以它显示错误为 - 9 补丁图像错误。通过将图像重命名为“imagename.png”,问题得到解决。
-
@EugenPechanec。非常感谢。你拯救了我的一天。