繁体   English   中英

通知样式在带有 Android 的小米手机上应用时的 RemoteServiceException 11

[英]RemoteServiceException when notification style is applied on Xiaomi phones with Android 11

没有任何明显原因,带有 Android 11 的小米手机开始出现在 crashlytics 日志中。 通知发生了一些事情。 我们没有做任何太具体的事情,并且在其他 Android 11 设备上一切正常。 我无法在受影响的设备上重现此崩溃。 可能是什么原因?

第一次崩溃开始于 12 月初,到 1 月,数量迅速增长,从每天 10 次增加到 100 次以上

碰撞:

Fatal Exception: android.app.RemoteServiceException
Bad notification(tag=null, id=) posted from package my.application, crashing app(uid=, pid=): Couldn't inflate contentViewsjava.lang.ClassCastException: android.app.Notification$MediaStyle cannot be cast to android.app.Notification$MessagingStyle

通知方式:

    final MediaStyle style = new MediaStyle()
            .setMediaSession(token)
            .setShowActionsInCompactView(PREV_POSITION, PLAY_PAUSE_POSITION, NEXT_POSITION)
            .setCancelButtonIntent(STOP.notificationPending(mContext))
            .setShowCancelButton(true);
    setStyle(style);

这里同样的问题。 我认为这是 MIUI 的错误,而不是应用程序的错误。 MIUI 为自己的外观和感觉改变了很多通知部分。 它可能会在未来的 MIUI 更新中修复。

来自小米:

发现崩溃 position 我将推动研发尽快发布新版本

而且好像已经发布了

在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM