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

Posted 大果梨

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process \'command \'D:\\Program Files\\Java\\jdk1.7.0_79\\bin\\java.exe\'\' finished with non-zero exit value 1

 

重新创建了一个新的空的工程对比build.gradle 发现“buildToolsVersion \'23.0.3\'”出问题的工程是 buildToolsVersion \'24.0.3 \'。改完buildToolsversion后问题解决。我认为出现此问题还是版本兼容问题。jdk1.7使用最新的24.0.3.出现问题

 

 

以上是关于Error:Execution failed for task ':app:transformClassesWithDexForDebug'.的主要内容,如果未能解决你的问题,请参考以下文章

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

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

Error:Execution failed for task ':app:transformClassesWithDexForRelease'

Error:Execution failed for task ':app:processDebugManifest'. 合并冲突

Android异常篇 Error:Execution failed for task ‘:app:validateSigningDebug‘.

安卓中运行报错Error:Execution failed for task ':app:transformClassesWithDexForDebug'解决