I have an Android project that currently ends out of the heap during the dex step:
:app:dexXXXXX Exception in thread "pool-1-thread-4" java.lang.OutOfMemoryError: Java heap space
I would like to increase the jvm min / max settings in gradle, as we used to do with the Maven plugin:
<groupId>com.jayway.maven.plugins.android.generation2</groupId> <artifactId>android-maven-plugin</artifactId> <version>3.6.0</version> <extensions>true</extensions> <configuration> <sdk> <platform>${android.platform}</platform> </sdk> <undeployBeforeDeploy>true</undeployBeforeDeploy> <dex> <jvmArguments> <jvmArgument>-Xms1024m</jvmArgument> <jvmArgument>-Xmx2048m</jvmArgument> </jvmArguments> </dex>
But in the docs for the android plugin in gradle, I see only these options:
android { dexOptions { incremental false preDexLibraries = false jumboMode = false } }
Is there any way to do this? There is a gradle.properties file, but it seems to have only jvmargs for gradle.
android jvm gradle
Richard Guion
source share