Error:Execution failed for task ':app:transformClassesWithDexForDebug'解决记录

转载请标明出处: 

http://blog.csdn.net/lxk_1993/article/details/50511172

本文出自:【lxk_1993的博客】;   



3个错误non-zero exit value 1; non-zero exit value 2; non-zero exit value 3


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

> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'F:\Program Files (x86)\Java\jdk1.8.0_31\bin\java.exe'' finished with non-zero exit value 1



这个是由于依赖包反复了 (像v4和nineoldandroids),如图。app中实现了对easeUI的依赖,可是app和easeUI都加入了对这个包的依赖。所以就报这个错误,改动之后再报,就clean,rebuild一下



Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'F:\Program Files (x86)\Java\jdk1.8.0_31\bin\java.exe'' finished withnon-zero exit value 2


这个错误在app的build.gradle里面加入以下这句就好了。

android {
   
    defaultConfig {
        ...
        multiDexEnabled true
    }

}


Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'F:\Program Files (x86)\Java\jdk1.8.0_31\bin\java.exe'' finished withnon-zero exit value 3


这个错误就在app.bulid里面加上这句。再rebuild ,之后再执行即可了。4g能够看电脑配置改动(2g,3g,6g,8g)。

dexOptions {
    javaMaxHeapSize "4g"
}
如图:




posted on 2017-07-18 12:46  ljbguanli  阅读(135)  评论(0编辑  收藏  举报