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"
}
}
Similar Posts:
- Android Studio Error: java.exe” finished with non-z [Solved]
- AndroidStudio Error: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ‘:app:proces
- Flutter: Android dependency ‘com.android.support:support-v4’ has different version …
- java.util.zip.ZipException: duplicate entry: com/tencent/mm/a/a.class
- Duplicate files copied in APK META-INF/DEPENDENCIES
- The original project cannot compile and run normally after Android studio upgrade
- Execution failed for task ‘:app:checkDebugDuplicateClasses‘.
- Flutter run Error: The getter ‘body1’ isn’t defined for the class ‘TextTheme’. – ‘TextTheme’ is from ‘package:flutter/src/material/text_theme.dart’
- Could not find com.android.tools.build:gradle:3.3.0.
- [Solved] Android Studio Error: Could not initialize class com.android.sdklib.repository.AndroidSdkHandler