【发布时间】:2021-02-12 13:13:35
【问题描述】:
在没有任何明显原因的情况下,搭载 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);
【问题讨论】:
-
same Fatal Exception: android.app.RemoteServiceException: Bad notification(tag=null, id=100) 从包 in.shadowfax.gandalf 中发布,应用程序崩溃(uid=XX, pid=XX):无法膨胀 contentViewsjava.lang.ClassCastException:android.app.Notification$BigTextStyle 无法转换为 android.app.Notification$MessagingStyle
-
我们甚至没有使用 MessagingStyle 发布任何通知。你在使用 Freshchat SDK 吗?我们最近部署了它,可能是他们正在使用 MessagingStyle 通知
-
不,我们不使用它。
-
我也有同样的问题,从一月份开始
标签: android android-notifications android-mediaplayer xiaomi android-notification.mediastyle