在为我的本机项目进行发布构建时出现此错误:
Expiring Daemon because JVM heap space is exhausted
> Task :app:transformDexArchiveWithDexMergerForRelease FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithDexMergerForRelease'.
> java.lang.OutOfMemoryError (no error message)
进行了一些研究并进行了一些更改,如下:
android:largeHeap="true"
添加到AndroidManifest.xml中的应用程序标签中已添加
dexOptions {javaMaxHeapSize“ 4g”}在android / app / build.gradle文件中。
仍然无法消除此错误。任何永久性的方法来摆脱此错误,以及它是怎么引起的?
配置gradle.properties:
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=4096m -XX:+HeapDumpOnOutOfMemoryError
org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.configureondemand=true