OneSignal-Unity-SDK icon indicating copy to clipboard operation
OneSignal-Unity-SDK copied to clipboard

[Bug]: Invalid notification (no valid small icon) on some devices

Open MaxBaranuk opened this issue 3 years ago • 1 comments

What happened?

Lots of crash reports in analytics with such stack trace:

Fatal Exception: java.lang.RuntimeException: Unable to start receiver com.DgnGames.AndroidNotifications.UnityNotificationManager: java.lang.IllegalArgumentException: Invalid notification (no valid small icon)

Mostly on Samsung, but there are some other devices present (Amazon, Motorolla) Different Android versions

Steps to reproduce?

We can not reproduce this on any of our test devices. Pushes are received successfully, and no crashes are found.

What did you expect to happen?

Try to understand the reason of crashes

Unity version

2021.3.4f1

OneSignal Unity SDK version

3.0.2

Platform

Android

Relevant log output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

MaxBaranuk avatar Nov 07 '22 16:11 MaxBaranuk

@MaxBaranuk Thanks for reporting, based on the error you submitted it looks be an issue with your com.DgnGames.AndroidNotifications.UnityNotificationManager Java class:

Fatal Exception: java.lang.RuntimeException: Unable to start receiver com.DgnGames.AndroidNotifications.UnityNotificationManager: java.lang.IllegalArgumentException: Invalid notification (no valid small icon)

OneSignal has its own push handler for Android so you don't need your own. If you don't need to process pushes from any other source than OneSignal you can remove push handling from your DgnGames.AndroidNotifications.UnityNotificationManager class. If you do remove it make sure to remove your AndroidManifest.xml entry too.

jkasten2 avatar Nov 15 '22 06:11 jkasten2