Android Studio compilation error Error:Execution failed for task ':app:transformClassesWithDexForDebug solution

Original address: http://blog.sina.com.cn/s/blog_6f3828770102w30b.html


Record the error type of 3 errors 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


This is because the dependency package is repeated, as shown in the figure. The dependency on easeUI is implemented in the app, but both the app and easeUI add a dependency on this package. So report this error, report it after modification, just clean and 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


This error comes after commenting out the v4 package in the app. The solution is to clean and rebuild the project, and it will be solved. If that doesn't work, restart it.


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


For this error, add this sentence to app.bulid, rebuild it, and then run it again. 4g can see the computer configuration modification (2g, 3g, 6g, 8g).

 

dexOptions {
    javaMaxHeapSize "4g"
}
As shown in the figure:

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325901532&siteId=291194637