android studio app:transformClassesWithDexForDebug
<pre><code>Uncaught translation error: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
&gt; com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_66\bin\java.exe'' finished with non-zero exit value 1
</code></pre>

<p>Continously getting this error everytime i try to run the project</p>

<p>Already added</p>

<pre><code>dexOptions {
    javaMaxHeapSize "4g"
}
</code></pre>

<p>Also, have added <code>multidexEnabled true</code></p>

<p>in build.gradle and restarted android studio many a times, but still receiving the same error.</p>

<p>Not even able to run the app once.</p>

<p>-------------SOLVED-------------  </p>

<p>Previously i had put environment variable in the system named <code>_JAVA_OPTIONS</code> with <code>-Xmx1024M</code> value and i changed it to <code>-Xmx2048M</code> and it solved the issue.</p>