Android - 错误:任务 ':app:mergeDebugResources' 执行失败

新手上路,请多包涵

请帮我!

这是错误说:

错误:任务 ‘:app:mergeDebugResources’ 执行失败。

错误:java.util.concurrent.ExecutionException:com.android.ide.common.process.ProcessException:

我的应用程序 gradle 是:

 apply plugin: 'com.android.application'
android {
  compileSdkVersion 25
  buildToolsVersion "25.0.1"
  packagingOptions {
    exclude 'META-INF/NOTICE' // will not include NOTICE file
    exclude 'META-INF/LICENSE' // will not include LICENSE file
  }
defaultConfig {
    applicationId "com.aku.ec2ainun.stepondesign"
    minSdkVersion 18
    targetSdkVersion 25
    versionCode 1
    versionName "1.1"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled true
}
dexOptions {
    javaMaxHeapSize "4g"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }
}
dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
   androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.firebase:firebase-client-android:2.5.2'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.android.gms:play-services:10.0.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:25.0.1'
compile 'com.android.support:multidex:1.0.1'
compile files('libs/slider.jar')
}
apply plugin: 'com.google.gms.google-services'

我的项目等级:

 buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.2.3'
    classpath 'com.google.gms:google-services:3.0.0'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
 }
}
allprojects {
  repositories {
    jcenter()
 }
}
task clean(type: Delete) {
   delete rootProject.buildDir
}

原文由 ec2ainun 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 812
2 个回答

在您的模块上尝试代码 build.gradle

 android {
// ...
aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false
// ...
}

这意味着 Android studio 严格检查 PNG。

原文由 Stackoverflow 发布,翻译遵循 CC BY-SA 3.0 许可协议

在我的项目中添加 9 个补丁图像后,我遇到了同样的问题。删除该图像解决了我的问题。

原文由 Ahsan Hayat 发布,翻译遵循 CC BY-SA 3.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题