简体   繁体   中英

error while generating android signed app

i am getting this error while generating android signed app

Error:Execution failed for task ':app:dexRelease'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2

this is my files 图片1

图片2

I had the same error once. For me increasing the Java maximum heap size solved the error. Try adding

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

to your build.gradle file.

Another reason for this error can be that your app is to big and you need to enable multidex support. Please see Building Apps with Over 65K Methods

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM