title: How do you adjust jvm args for dex memory in gradle?
body: <p>I have an Android project which is currently running out of heap space during the dex step:</p>
  
  <pre><code> :app:dexXXXXX Exception in thread "pool-1-thread-4"  java.lang.OutOfMemoryError: Java heap space
  </code></pre>
  
  <p>I would like to bump up the jvm min/max settings in gradle like we used to do with the Maven plugin:</p>
  
  <pre><code>      &lt;groupId&gt;com.jayway.maven.plugins.android.generation2&lt;/groupId&gt;
        &lt;artifactId&gt;android-maven-plugin&lt;/artifactId&gt;
        &lt;version&gt;3.6.0&lt;/version&gt;
        &lt;extensions&gt;true&lt;/extensions&gt;
        &lt;configuration&gt;
          &lt;sdk&gt;
            &lt;platform&gt;${android.platform}&lt;/platform&gt;
          &lt;/sdk&gt;
          &lt;undeployBeforeDeploy&gt;true&lt;/undeployBeforeDeploy&gt;
          &lt;dex&gt;
            &lt;jvmArguments&gt;
                &lt;jvmArgument&gt;-Xms1024m&lt;/jvmArgument&gt;
                &lt;jvmArgument&gt;-Xmx2048m&lt;/jvmArgument&gt;
            &lt;/jvmArguments&gt;
          &lt;/dex&gt;
  </code></pre>
  
  <p>But in the docs for the android plugin in gradle I only see these options:</p>
  
  <pre><code>   android {
      dexOptions {
          incremental false
          preDexLibraries = false
          jumboMode = false
      }
     }
  </code></pre>
  
  <p>Is there a way to do it?  There is a gradle.properties file but that just seems to have jvmargs for gradle itself.</p>