OneSignal / OneSignal-Android-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your native Android or Amazon app with OneSignal. https://onesignal.com
Other
592 stars 368 forks source link

Notification Icon Creation Failure in OneSignal Integration [Bug]: #2090

Open Nass33m opened 1 month ago

Nass33m commented 1 month ago

What happened?

We are experiencing a RemoteServiceException with the message "Bad notification posted from package..." followed by "Couldn't create icon". This issue seems to occur when trying to display notifications in our app, particularly when using OneSignal for push notifications. The error message indicates a failure in creating the notification icon, which leads to the app crashing.

Steps to reproduce?

No idea of how to reproduce, in testing everything worked fine... but in production some users got this crash

What did you expect to happen?

I believed that OneSignal handled the icon faillure/not existing in their code

OneSignal Android SDK version

5.1.12

Android version

13, 12

Specific Android models

No response

Relevant log output

Fatal Exception: android.app.RemoteServiceException: Bad notification posted from package com.XXXXX.XXXX.XXXX: Couldn't create icon: StatusBarIcon(icon=Icon(typ=RESOURCE pkg=com.XXXXX.XXXX.XXXX id=0x7f0700bc) visible user=0 )
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2204)
       at android.os.Handler.dispatchMessage(Handler.java:108)
       at android.os.Looper.loop(Looper.java:166)
       at android.app.ActivityThread.main(ActivityThread.java:7529)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)

Code of Conduct

emawby commented 1 month ago

@Nass33m What icon format are you using? Do you use png icons?

Nass33m commented 1 month ago

@emawby Yes I use png icons (sorry for the late response).