To run dex in process, the Gradle daemon needs a larger heap. It currently has approximately 910 MB

Update from June 25, 2017 At Google IO 2017 there was some updates about this topic. It’s not recommended anymore to set the flag on the dexOptions, so if you have something like the next, you can delete it. dexOptions { javaMaxHeapSize “2g” } Source: Speeding Up Your Android Gradle Builds Original answer: Android Studio … Read more