For faster builds, increase the maximum heap size for the Gradle daemon to at least 4608 MB

来源:互联网 发布:三元表达式 java 编辑:程序博客网 时间:2024/05/06 16:17

编译工程出现这个问题:

To run dex in process, the Gradle daemon needs a larger heap.

It currently has 1024 MB.
For faster builds, increase the maximum heap size for the Gradle daemon to at least 4608 MB (based on the dexOptions.javaMaxHeapSize = 4g).
To do this set org.gradle.jvmargs=-Xmx4608M in the project gradle.properties.
For more information see https://docs.gradle.org/current/userguide/build_environment.html
Error:Error: Could not create the Java Virtual Machine.
Error:Error: A fatal exception has occurred. Program will exit.
Error:Invalid maximum heap size: -Xmx4g

Error:The specified size exceeds the maximum representable size.


根据提示的解决方法添加后,又报org.gradle.jvmargs=-Xmx不能超过一个数值(小于4G),

后来发现是自己配置的jdk是32位的,系统64位,默认的限制不超过4G,更换64位JDK后解决。

0 0