原文地址:http://blog.csdn.net/zhangxy0605/article/details/73603798
最近遇到这个报错,
Error:Execution failed for task ':inferentdemo:processDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException:
Process 'command 'D:\AndroidStudio\Android\sdk\build-tools\22.0.1\aapt.exe''
finished with non-zero exit value 1
网上找了好多方法,结合自己的解决方法,做下总结。
解决方法有三种:
1. 修改Gradle中 的buildToolsVersion 与targetSdkVersion 一致
如:
android {
compileSdkVersion 21
buildToolsVersion "21.0.2"
defaultConfig {
applicationId "com.sample.inferentdemo"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
- 删除多余的或重复的 jar 文件。
- 检查添加的资源文件的名字是否规范,不能含有特殊字符,如:中文, - 等,最好是以常见的字母加下划线命名。