Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException

异常Log:

Error:Execution failed for task ‘:app:dexDebug’. 
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘/Library/……/java” finished with non-zero exit value 2

错误原因:

这个异常在Android Studio编译运行的时候出现,原因是项目中引用了重复的jar包,这可能是因为新引入的library module中有和主项目中重复引用的jar包,需要重点检查 Android 兼容包 support-v4 和 support-v7 包,还有一些常用的开源项目,例如Gson,Nineoldandroids…,这些常用的开源项目有可能在你引用的 library 项目中已经被引用过了。

解决办法:

解决这个问题我们只需要删除主项目中 libs 文件夹中和 library中重复的部分即可,另外,我推荐大家改变将 jar 包放在 libs 目录中的习惯,而使用 Gradle 构建,在 module 下的 build.gradle 目录下将

dependencies {
    compile files(‘libs/nineoldandroids-2.4.0.jar‘)
}
  • 1
  • 2
  • 3

dependencies {
    compile fileTree(dir: ‘libs‘, include: [‘*.jar‘])
}
  • 1
  • 2
  • 3

改为

dependencies {
    compile ‘com.nineoldandroids:library:2.4.0‘
}
  • 1
  • 2
  • 3

参考链接中,我发现一个类似的异常

Error:Execution failed for task ‘:app:dexDebug’. 
> com.android.ide.common.internal.LoggedErrorException

出现这个错误是因为主项目和Library项目中都引用了 compile ‘com.nineoldandroids:library:2.4.0’ ,但我在最新的 Android Studio 1.3 Preview 和 Gradle 2.3中给主项目和Library项目进行了一次模拟,却没有出现该异常,根据问题中给出了 build.gradle 文件,这可能是因为使用了低版本Android Studio 或 Gradle 的缘故,所以大家最好还是在项目中检查一下,library项目中已经引入的jar,library就不要再引入到主项目中了。

参考链接:

http://stackoverflow.com/questions/27675717/gradle-error-execution-failed-for-task-appdexdebug/27675841

Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException

时间: 2024-08-05 08:30:38

Error:Execution failed for task ':app:dexDebug'. > com.android.ide.common.process.ProcessException的相关文章

Error:Execution failed for task ':app:dexDebug'.> com.android.ide.common.process.ProcessException: o

出现上述问题 检查下是否多次引用同一个jar包 有以下情况 1. module下jar包版本不同 2. 同一个module 在libs中包含了.jar,而在src下又把相应的source页加入了 3. gradle中是否重复编译,比如 已经加了compile fileTree(include: ['*.jar'], dir: 'libs') 然而在下面又加一句compile files('libs/xxx.jar') 参考 Error:Execution failed for task ':ap

Error:Execution failed for task ':app:dexDebug'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2解决:build.gradle中添加: defaultCon

[Exception Android 20] - Error:Execution failed for task ':app:processDebugResources'

Error:Execution failed for task ':app:processDebugResources'. > com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\Android\adt-bundle-windows-x86_64-20140702\sdk\build-tools\22.0.1\aapt.ex

Error:Execution failed for task ':app:processDebugResources'.

Error:Execution failed for task ':app:processDebugResources'.> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'E:\andorid\android-studio-bundle-windows\sdk\build-tools\24.0.0-preview\aapt.

Android Studio 运行出现 Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.

转载请标明出处: http://www.cnblogs.com/why168888/p/5978381.html 本文出自:[Edwin博客园] 我引用compile 'com.squareup.retrofit2:converter-jackson:2.1.0'Gradle没有错误,运行APP就出了这个error. 错误日志:Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.> c

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.

使用android studio 时,编译成功但用build apk时却报错 环境: android studio 1.5, jdk1.7 错误:Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: ja

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug

这几天eclipse 项目迁移 android studio Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/accessibilityservice/Ac

Error:Execution failed for task ':app:transformClassesWithDexForDebug'解决方法

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.transform.api.TransformException: java.util.zip.ZipException: duplicate entry: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 类似问题我通过审查build.gradle引用的lib,把所有功能重复

Error:Execution failed for task ':app:compileDebugAidl'. > aidl is missing(Android Studio编译错误)

今天下载了一个1.2.1.1版本的Android Studio,使用VPN更新好SDK之后就新建了一个hello world工程测试一下环境,然后就出现以下错误: Error:Execution failed for task ':app:compileDebugAidl'. > aidl is missing 什么情况?全新安装的环境也有错误?Google发布这个工具时没有测试好吗? 没搞过这个工具,一阵搜索得到以下方案: 1.右键工程->Open Module Settings 2.将Bu