构建APK错误ExecutionException:java.lang.OutOfMemoryError:

时间:2016-11-28 00:48:55

标签: android android-gradle

我正在尝试构建我的应用程序的APK,但我收到了这些错误。有人知道原因吗?请帮我解决问题。

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

1 个答案:

答案 0 :(得分:1)

转到grade.properties并为我的Gradle分配更多内存: -

org.gradle.jvmargs=-Xmx2048m

如果崩溃仍然存在,则将其添加到应用程序标记内的清单中: -

android:largeHeap="true"