I use OneSignal SDK
to show notifications.
I do it in OneSignalPushService.java
.
OneSignalPushService.java:
p
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.