首页 > 代码库 > Error:Execution failed for task ':app:transformClassesWithDexForDebug'.

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'.