增加gradle堆大小 [英] Increasing the gradle heap size

查看:128
本文介绍了增加gradle堆大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我尝试构建该应用程序时,gradle都会花费太多时间,并且会显示一条消息,提示您应将Gradle大小增加到3072 MB,当前为910 MB.所以我的问题是如何增加gradle的堆内存?

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

推荐答案

只需添加

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

在您的build.gradle文件中

这篇关于增加gradle堆大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆