Android studio java.exe finished with non-zero exi

2019-02-09 05:45发布

I have pass through non-zero exit value 1,2, related to multidex issue, but now I am getting non-zero exit value 3.

Studio Message :

Information:Gradle: Executing tasks: [:emoticons_lib_proj:assembleDebug, :myProject_Developement:assembleDebug]
Information:5/27/2015 5:56 PM - Compilation completed with 1 error and 0 warnings in 5m 58s 77ms
Error:Gradle: Execution failed for task ':myProject_Developement:dexDebug'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_20\bin\java.exe'' finished with non-zero exit value 3

I hope someone might have faced the issue and fixed. kindly let me know where I am misleading,

5条回答
Melony?
2楼-- · 2019-02-09 06:20

FIXED SOLUTION: Increased the HEAP size to 2g or 4g.

android {
    defaultConfig {}

    dexOptions {
        javaMaxHeapSize "4g"
    }

    packagingOptions {
    }

    buildTypes {
    } }
查看更多
贼婆χ
3楼-- · 2019-02-09 06:25

I have the same issue almost every day, and I always get rid of it by clearing and rebuilding the project. The worst case is restarting Android Studio.

查看更多
成全新的幸福
4楼-- · 2019-02-09 06:27

I fixed my issue with: android{ dexOptions { javaMaxHeapSize "4g" } } try will make fix even you issue. I hope so..

查看更多
我命由我不由天
5楼-- · 2019-02-09 06:28

In my case, it seems to happen when running low on memory. I run Android Studio on a Windows 7 with 8 GB RAM, and every time the total RAM usage gets near 6 GB I get the same error code or a different one ("java.exe finished with non-zero exit value 1").

Closing some or all other programs (such as Internet browser, Android emulator) always solve the problem for me.

查看更多
疯言疯语
6楼-- · 2019-02-09 06:41

When your project contains large number of classes, android studio will throw out non-zero exit value 3 error.

To solve the error, add this in build.gradle file and sync project with gradle.

dexOptions {
    javaMaxHeapSize "4g"
}
查看更多
登录 后发表回答