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

后端 未结 2 1235
旧时难觅i
旧时难觅i 2021-02-07 14:16

I use OneSignal SDK to show notifications. I do it in OneSignalPushService.java.

OneSignalPushService.java:

p         


        
相关标签:
2条回答
  • 2021-02-07 14:44

    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.

    0 讨论(0)
  • 2021-02-07 15:01

    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.

    0 讨论(0)
提交回复
热议问题