Android studio java.exe finished with non-zero exit value 3

前端 未结 5 2010
情深已故
情深已故 2021-01-02 10:19

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:Grad         


        
相关标签:
5条回答
  • 2021-01-02 10:29

    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.

    0 讨论(0)
  • 2021-01-02 10:31

    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"
    }
    
    0 讨论(0)
  • 2021-01-02 10:35

    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.

    0 讨论(0)
  • 2021-01-02 10:49

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

    android {
        defaultConfig {}
    
        dexOptions {
            javaMaxHeapSize "4g"
        }
    
        packagingOptions {
        }
    
        buildTypes {
        } }
    
    0 讨论(0)
  • 2021-01-02 10:49

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

    0 讨论(0)
提交回复
热议问题