title: Unity3d Android Java heap space error
body: <p>I have a unity3d Android project that has 500 mg APK. I have started to get "Java heap size error" and I know how to solve this in Android Studio, just increase the size in gradle.properties file, but on Unity? Unity only let`s you "see" the mainTemplate.gradle file.</p>
  
  <p>I am using Unity3d 2018.1.0f2 editor.</p>
  
  <p>I have also tried to use Internal build system but when I do that my game simply don`t work, but the build passes.</p>
  
  <p>I have exposed the custom gradle file (Assets/Plugins/Android/mainTemplate.gradle) and added the field and values in the Android field like this:</p>
  
  <pre><code>dexOptions {
      // Prevent OutOfMemory with MultiDex during the build phase
      javaMaxHeapSize "8g"        
  }
  </code></pre>
  
  <p>But the error persists. Did anyone had this kind of problems with Unity Android builds ? </p>
  
  <p><a href="https://i.stack.imgur.com/5lXWR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5lXWR.png" alt="enter image description here"></a></p>
  
  <p>Adding Build-settings screenshot:
  <a href="https://i.stack.imgur.com/uxxRL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uxxRL.png" alt="enter image description here"></a></p>