4

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 ??

Vikrant singh
  • 433
  • 1
  • 7
  • 25
  • Already answered here: http://stackoverflow.com/questions/37090135/to-run-dex-in-process-the-gradle-daemon-needs-a-larger-heap-it-currently-has-a – PseudoAj May 13 '16 at 07:33

1 Answers1

10

Just add

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

in your build.gradle file

Juan Campa
  • 1,181
  • 2
  • 14
  • 20
M D
  • 47,665
  • 9
  • 93
  • 114