FirebaseMessagingService Resources$NotFoundException

记录使用微信资源包混淆插件引发的血案


android.content.res.Resources$NotFoundException
String resource ID #0x0
com.google.firebase.messaging.FirebaseMessagingService.f(SourceFile:8)
android.content.res.Resources.getText(Resources.java:360)
android.content.res.MiuiResources.getText(MiuiResources.java:97)
android.content.res.Resources.getString(Resources.java:453)
android.content.Context.getString(Context.java:587)
c.m.b.s.a.b(SourceFile:24)
c.m.b.s.a.b(SourceFile:3)
c.m.b.s.c.a(SourceFile:5)

这个错误的引发找了好久,看日志就是FirebaseMessagingService导致的,但没那么简单。上个版本为了项目的安全,做了混淆、微信资源文件混淆、 加固,上报后崩溃直线上升。Google了才知道原来是因为这—>

I found the problem.
Firebase load a string with name and not with R.string….
int var5 = var0.getResources().getIdentifier(“fcm_fallback_notification_channel_label”, “string”, var0.getPackageName());
Then Dexguard remove this string.

With these two lines in the dexguard configuration you specify to keep the string above and all the strings that start with “fcm_”
-keepresources string/fcm_fallback_notification_channel_label
-keepresources string/fcm_*

这样只能暂时放弃资源 文件的混淆了,怕以后再出问题,加入白名单也不是解决问题的方法。不知道谁有好的办法吗

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值