Android打包提示Missing classes detected while running R8 错误解决方案

2023年11月08日

开启R8进行代码混淆和压缩的时候,出现以下错误:

 

Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in you path to mmissing_rules.txt

 

解决办法:

 

在 app -> build -> outputs -> mapping -> release-> 目录下找到 missing_rules.txt 文件,然后将文件里类似

-dontwarn android.os.ServiceManager
-dontwarn com.bun.miitmdid.core.MdidSdkHelper
-dontwarn com.bun.miitmdid.interfaces.IdSupplier
-dontwarn com.google.firebase.iid.FirebaseInstanceId
-dontwarn com.google.firebase.iid.InstanceIdResult
-dontwarn com.tencent.android.tpush.otherpush.OtherPushClient

的内容复制到 proguard-rules.pro 文件即可。

 

© 1987 - 2023 张晓刚 版权所有

浙ICP备16002143号-1