错误:: R8: java.lang.OutOfMemoryError: 超出 GC 开销限制
我们正在开发一个项目,其中包括根据多个 sdk(内部开发)开发的许多新代码,当我们开始将新代码更改与团队开发的 sdk 一起集成时,我们收到以下错误:
minifyReleaseWithR8
WARNING:: R8: Missing class: org.conscrypt.ConscryptHostnameVerifier
WARNING:: R8: Missing class: com.bun.miitmdid.interfaces.IIdentifierListener
ERROR:: R8: java.lang.OutOfMemoryError: GC overhead limit exceeded
需要注意的是,这种情况是在从我们的 CI 管道创建构建时发生的,并且在我们的本地计算机上完美运行。访问过多个帖子,提到了要在 jvm 内存选项中进行的更改。以下是我们在“gradle.properties”和“build.gradle”中定义的属性。
Gradle 守护进程配置
org.gradle.jvmargs=-Xmx3g -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
android.useAndroidX=true
android.enableJetifier=true
我们通过增加和减少“org.gradle.jvmargs”和“MaxPermSize”的值尝试了所有组合,但没有成功。
android {
//Other configs
dexOptions {
javaMaxHeapSize "4g"
}
}
我们甚至尝试将 CI 运行器配置从 8GB RAM 增加到 16GB RAM(4 核),但仍然没有成功。
We are working on a project which includes lot of new code being developed in terms of multiple sdk's (Being developed in-house) and when we started integrating the new code changes coming along with the sdk's developed by the teams we are getting below error:
minifyReleaseWithR8
WARNING:: R8: Missing class: org.conscrypt.ConscryptHostnameVerifier
WARNING:: R8: Missing class: com.bun.miitmdid.interfaces.IIdentifierListener
ERROR:: R8: java.lang.OutOfMemoryError: GC overhead limit exceeded
The thing to be noted is this is happening while creating build from our CI pipeline and works perfectly on our local machines. Have visited multiple posts mentioning the changes to be done in jvm memory options. Below are the properties we have defined in "gradle.properties" and "build.gradle".
Gradle daemon config
org.gradle.jvmargs=-Xmx3g -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
android.useAndroidX=true
android.enableJetifier=true
We have tried all the combinations by increasing and decreasing the values for "org.gradle.jvmargs" and "MaxPermSize" but no success.
android {
//Other configs
dexOptions {
javaMaxHeapSize "4g"
}
}
We have even tried increasing the CI runner configration from 8GB RAM to 16GB RAM (4core) but still no success.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论