Bad Notification: Couldn't expand RemoteViews for: StatusBarNotification. on Android Nougat

扶醉桌前 提交于 2019-12-03 10:43:39

I think this crash happens because your notification include the integer reference to the icon in the PendingIntent bundle, and that integer was later being referenced while being posted to the NotificationManager.

In between getting the integer reference and the pending intent going off, the app was updated and all of the drawable references changed. The integer that used to reference the correct drawable now referenced either the incorrect drawable or none at all (none at all - causing this crash)

This is evidenced by

I noticed that number of devices with this issue increase for a week when I release a new version of the app later these numbers decrease to zero.

As a solution you can rebuild all notifications after the application has been updated.

Developers of OneSignal suggest to do next a work around:

Add following under the <application> tag in a AndroidManifest.xml

<manifest ...>
    <application ...>
        ...
        <receiver android:name="com.onesignal.UpgradeReceiver" tools:node="remove" />
    </application>
</manifest>

These crashes disappeared when I did this temporary solution.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!