Tag Archives: error:execution failed for task ‘:app:transformclasseswithdexfordebug’. > co

[Solved] error:execution failed for task ‘:app:transformclasseswithdexfordebug’. > co

3 error: 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 duplicated (like v4 and v7), as shown in the figure. app implements dependency on v7, but app and v7 both add dependency on v4 package. So this error is reported, and if it is reported again after modification, then clean and rebuild 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 2

This error is solved by adding the following line to the app’s 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

This error is added to the app.bulid, and then rebuild, and then run it again. 4g can be modified depending on the computer configuration (2g, 3g, 6g, 8g).


android {
    ****
    dexOptions {
    javaMaxHeapSize "4g"
    }
}