Unity-Technologies / com.unity.mobile.notifications

Mobile Notifications Package
https://docs.unity3d.com/Packages/com.unity.mobile.notifications@2.1/manual/index.html
Other
132 stars 42 forks source link

[Android] Bad notification posted from package com.***: Couldn't create icon: StatusBarIcon #148

Closed artyom-v closed 1 year ago

artyom-v commented 2 years ago

Plugin v1.5.0 Unity v2020.3.25f1

Sometimes the following exception has occurred: `Fatal Exception: java.lang.Error: FATAL EXCEPTION [main]

Caused by android.app.RemoteServiceException: Bad notification posted from package com. : Couldn't create icon: StatusBarIcon(icon=Icon(typ=RESOURCE pkg=com. id=0x7f080102) visible user=0 ) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1802) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6682) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)`

Some thoughts on the reason for this exception.

aurimasc commented 2 years ago

The StackOverflow has lots of speculations with nothing solid. Could you submit a bug report via Unity Editor with a repro project?

artyom-v commented 2 years ago

Unfortunately, I can't reproduce this exception in a project on test devices. This exception was received through Firebase Crashlytics from users playing production build. Notifications are created when the focus is lost (using AndroidNotificationCenter.SendNotification) and are removed on the application start or focus gain (using AndroidNotificationCenter.CancelAllNotifications())

artyom-v commented 2 years ago

This was probably fixed by 19a3d9d4f064d1f814138aedc5dc1ffa061cb3a8 I need to wait to get more statistics to confirm.

artyom-v commented 2 years ago

Unfortunately, the issue still exists on a small number of devices.

rusitschka commented 2 years ago

Having the same issue with latest master (80e64b8d5ee22387a96528e903773f8d5d81d193).

Inspyro commented 2 years ago

Can confirm it also happens to us, so far only on Galaxy Tab A (2016) Android 8.1.0 (with MobileNotifications 2.0.0)

anhnhgtv commented 2 years ago

still error

solinvictus1313 commented 2 years ago

After the latest update to my app, I'm seeing the same issue in Crashlytics. I have not touched the code for notifications, or the version of the notifications package. What I did change are the notification icons.

A bit of searching brought me to this thread & answer on Stack Overflow, which seems to make sense. A different answer on the same thread explains a way in which the receiver can handle this situation via registering a PACKAGE_CHANGED listener and acting accordingly.

While the crash numbers on Crashlytics aren't catastrophic, it would be very nice indeed if those avoidable crashes wouldn't happen in the first place.

aurimasc commented 1 year ago

Maybe you have extra data. The theory about package update with notification already present should be easy to determine by a short spike in number of issues soon after update is released.

aurimasc commented 1 year ago

Closing as no replies.