Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increasing the gradle heap size [duplicate]

Whenever I try to make the build of the app , gradle takes too much of time and there comes a message showing that you should increase the Gradle size to 3072 MB , currently it is 910 MB . so my question is how can I increase the heap memory of gradle ??

like image 669
Vikrant singh Avatar asked Dec 25 '22 05:12

Vikrant singh


1 Answers

Just add

 android {
 ....
 dexOptions {
    // Prevent OutOfMemory with MultiDex during the build phase
    javaMaxHeapSize "4g"
  }
}

in your build.gradle file

like image 135
M D Avatar answered Dec 30 '22 13:12

M D