【发布时间】:2016-08-18 10:20:15
【问题描述】:
谁能告诉我如何解决这个错误:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion '21.1.2'
defaultConfig {
applicationId "com.example.abhishek.detector"
minSdkVersion 10
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.google.android.gms:play-services-location:8.1.0'
}
错误: 错误:任务 ':app:processDebugResources' 执行失败。
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\hp-pc\AppData\Local\Android\sdk\build-tools\ 21.1.2\aapt.exe'' 以非零退出值 1 结束
【问题讨论】:
-
您是否尝试过清理和重建?
-
是的很多............
-
尝试在
defaultConfig中添加multiDexEnabled true。 -
尝试@jaydroider 建议
-
您的支持库版本和编译 SDK 版本必须匹配。尝试使用 API 级别 23 并更新您的编译 SDK 版本和目标 SDK 版本。否则使用 21.*.* 版本的支持库。希望它会有所帮助:) 不要忘记投票!
标签: android android-studio android-gradle-plugin