[英]Building signed APK of release build fails but debug succeeds. Missing class
When going to build the signed APK for my app if I select the debug build it compiles fine, but when I choose the release build it sits on在为我的应用程序构建签名的 APK 时,如果我选择调试版本,它编译得很好,但是当我选择发布版本时,它位于
:app:transformClassesAndResourcesWithR8ForRelease
:app:transformClassesAndResourcesWithR8ForRelease
and it says它说
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
引起:java.lang.OutOfMemoryError:超出GC开销限制
as well as也
AGPBI: {"kind":"warning","text":"Missing class android.arch.paging.PositionalDataSource","sources":[{}],"tool":"D8"}
AGPBI: {"kind":"warning","text":"缺少类 android.arch.paging.PositionalDataSource","sources":[{}],"tool":"D8"}
I have tried adding to my build.gradle(module)我曾尝试添加到我的 build.gradle(module)
dexOptions{
javaMaxHeapSize "8g"
}
as well as adding some ignoring to the proguard.cfg以及在 proguard.cfg 中添加一些忽略
NOTE: I am using MacOS if that might have anything to do with it注意:我正在使用 MacOS,如果这可能与它有关
Proguard (which is turned on by default for release builds if I'm not mistaken) should be used very carefully.应该非常小心地使用 Proguard(如果我没记错的话,它默认为发布版本打开)。
ANY code that uses reflection might stop working if obfuscated so if you do want to use Proguard - you need to determine which classes are to be used with reflection and exclude (keep as is ) them.如果混淆,任何使用反射的代码都可能会停止工作,因此如果您确实想使用 Proguard - 您需要确定哪些类将与反射一起使用并排除(保持原样)它们。
More info here : https://www.guardsquare.com/en/products/proguard/manual/examples .更多信息请访问: https : //www.guardsquare.com/en/products/proguard/manual/examples 。
Good luck.祝你好运。
I had the same issue with the same stack trace.我对相同的堆栈跟踪有同样的问题。 In my case, there were missing
org.gradle.jvmargs=-Xms512M -Xmx4g -XX:MaxPermSize=1024m -XX:MaxMetaspaceSize=1g -Dkotlin.daemon.jvm.options="-Xmx1g"
configs in the gradle.propertis file.就我而言,
org.gradle.jvmargs=-Xms512M -Xmx4g -XX:MaxPermSize=1024m -XX:MaxMetaspaceSize=1g -Dkotlin.daemon.jvm.options="-Xmx1g"
中缺少org.gradle.jvmargs=-Xms512M -Xmx4g -XX:MaxPermSize=1024m -XX:MaxMetaspaceSize=1g -Dkotlin.daemon.jvm.options="-Xmx1g"
配置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.