Error: com.android.ide.common.process.ProcessException

转载请标明出处:http://blog.csdn.net/xx326664162/article/details/55098940 原文出自:薛瑄的博客

你也可以查看我的其他同类文章,也会让你有一定的收货!

之前出现过这样的错误,百度后解决了,但是昨天又遇到这个问题,搞了好久又发现一个比较容易忽略的问题,分享一下这个坑,希望大家可以轻松的跳过。

错误

这种问题大多出现在,把项目从eclipse导入android studio

Error:java.util.concurrent.ExecutionException:com.android.ide.common.process.ProcessException:
Error:Execution failed for task':app:mergeDebugResources'.
>Error:java.util.concurrent.ExecutionException:com.android.ide.common.process.ProcessException: 

这里写图片描述

原因分析:

1、.9图片的拉伸和填充区域,不完整
2、有的图片损坏,不能正常显示

解决方法:

第一种:

在Android Studio中点击.9 图片,检查一下项目中.9 格式图片的拉伸区域和填充区域,特别特别注意:填充区域必须是连续的

第二种:

在你的主工程文件夹里的build.gradle文件里,加上下面这两句:

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

It means Android studio DO NOT check PNG strictly.

但是我在android studio 2.2.3的Gradle Console看到下面这段编译信息:

useNewCruncher has been deprecated. It will be removed in a future version of the gradle plugin. New cruncher is now always enabled.

2.2.3的版本不能使用useNewCruncher这个设置,网上找了一下,也没用类似的替代方案

参考:android studio导入后,编译失败

禁止 Gradle 检查png的合法性

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

Android - Error:Execution failed for task ‘:app:mergeDebugResources’

异常处理之[Error: com.android.ide.common.process.ProcessException]

发布了244 篇原创文章 · 获赞 799 · 访问量 234万+
展开阅读全文

请问,编译出现此错误ProcessException -> ExecutionException

08-05

请问谁有好的处理办法 ![图片说明](https://img-ask.csdn.net/upload/201908/05/1564976838_90724.png) ``` Caused by: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.android.dx.command.Main with arguments {--dex --num-threads=4 --multi-dex --main-dex-list F:\hnswnew53\MXClient\build\intermediates\multi-dex\release\maindexlist.txt --output F:\hnswnew53\MXClient\build\intermediates\transforms\dex\release\0 --min-sdk-version 16 F:\hnswnew53\MXClient\build\intermediates\transforms\jarMerging\release\0.jar} at com.android.builder.core.DexByteCodeConverter.dexOutOfProcess(DexByteCodeConverter.java:221) at com.android.builder.core.DexByteCodeConverter.runDexer(DexByteCodeConverter.java:152) at com.android.builder.core.DexByteCodeConverter.convertByteCode(DexByteCodeConverter.java:135) at com.android.build.gradle.internal.transforms.DexTransform.transform(DexTransform.java:213) ... 42 more at com.android.build.gradle.internal.process.GradleProcessResult.buildProcessException(GradleProcessResult.java:73) at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:48) at com.android.builder.core.DexByteCodeConverter.lambda$dexOutOfProcess$1(DexByteCodeConverter.java:195) Caused by: org.gradle.process.internal.ExecException: Process 'command 'E:\androidstudio3\jre\bin\java.exe'' finished with non-zero exit value 1 at org.gradle.process.internal.DefaultExecHandle$ExecResultImpl.assertNormalExitValue(DefaultExecHandle.java:380) at com.android.build.gradle.internal.process.GradleProcessResult.assertNormalExitValue(GradleProcessResult.java:46) ... 1 more ``` 问答

android studio打包apk时报错

07-11

android studio 在添加了第三方库之后出现问题(编译ok,运行报错): ``` Error:duplicate files during packaging of APK E:\android\hikeplus\app\build\outputs\apk\app-debug-unaligned.apk Path in archive: assets/MojingSDK/InputMap_mojing_default.json Origin 1: E:\android\hikeplus\app\build\intermediates\res\resources-debug.ap_ Origin 2: E:\android\hikeplus\app\build\intermediates\transforms\mergeJavaRes\debug\jars\2\1f\main.jar You can ignore those files in your build.gradle: android { packagingOptions { exclude 'assets/MojingSDK/InputMap_mojing_default.json' } } Error:Execution failed for task ':app:packageDebug'. > Duplicate files copied in APK assets/MojingSDK/InputMap_mojing_default.json File1: E:\android\hikeplus\app\build\intermediates\res\resources-debug.ap_ File2: E:\android\hikeplus\app\build\intermediates\transforms\mergeJavaRes\debug\jars\2\1f\main.jar ``` 按照提示,在build.gradle中添加以下语句后的文件为: ``` apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.3" defaultConfig { applicationId "com.nuc.hikeplus" minSdkVersion 19 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } packagingOptions { exclude 'assets/MojingSDK/MobileConfig.json' exclude 'assets/MojingSDK/Glassesfig.json' exclude 'assets/MojingSDK/InputMap_default.json' } } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.2.1' compile 'com.android.support:design:23.2.1' compile files('libs/unity-classes.jar') compile files('libs/MojingSDK.jar') compile files('libs/MojingSDKUnity.jar') } ``` 编译成功但运行依旧提示该错误 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 代码科技 设计师: Amelia_0503

分享到微信朋友圈

×

扫一扫,手机浏览