Kevtho Kevtho - 8 days ago 9
Android Question

Building APK errors ExecutionException: java.lang.OutOfMemoryError:

I'm trying building the APK of my application, but i got these errors. Does anybody knows the reason? please help me solve the issues.

Error:Uncaught translation error: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Java heap space . Please assign more memory to Gradle in the project's gradle.properties file. For example, the following line, in the gradle.properties file, sets the maximum Java heap size to 1,024 MB: <em>org.gradle.jvmargs=-Xmx1024m</em> <a href="http://www.gradle.org/docs/current/userguide/build_environment.html">Read Gradle's configuration guide</a><br><a href="http://docs.oracle.com/javase/7/docs/technotes/guides/vm/gc-ergonomics.html">Read about Java's heap size</a>


Error:Uncaught translation error: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded


Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException

Answer

go to grade.properties and assign more memory to Gradle, for mine :-

org.gradle.jvmargs=-Xmx2048m

if the crash still exists then add this into your manifest within application tag:-

android:largeHeap="true"