Java lang illegalargumentexception invalid notification no valid small icon

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

What happened?

Lots of crash reports in analytics with such stack trace:

Читайте также:  Add html link to javascript

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

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔥 Messaging error: Invalid notification (no valid small icon) #2231

🔥 Messaging error: Invalid notification (no valid small icon) #2231

Comments

Issue

I trying to send notification in firebase console, but sometime can receive that more time can’t,first i thought it is network problem until i see the error log:

DisplayNotificationTask: java.lang.IllegalArgumentException: Invalid notification (no valid small icon): Notification(channel=channelId pri=1 contentView=null vibrate=null sound=null defaults=0x0 flags=0x0 color=0xff000000 vis=PRIVATE semFlags=0x0 semPriority=0 semMissedCount=0)
06-13 20:51:47.801 2070 5153 E DisplayNotificationTask: at android.app.NotificationManager.notifyAsUser(NotificationManager.java:417)
06-13 20:51:47.801 2070 5153 E DisplayNotificationTask: at android.app.NotificationManager.notify(NotificationManager.java:379)
06-13 20:51:47.801 2070 5153 E DisplayNotificationTask: at io.invertase.firebase.notifications.DisplayNotificationTask.doInBackground(DisplayNotificationTask.java:383)
06-13 20:51:47.801 2070 5153 E DisplayNotificationTask: at io.invertase.firebase.notifications.DisplayNotificationTask.doInBackground(DisplayNotificationTask.java:32)
06-13 20:51:47.801 2070 5153 E DisplayNotificationTask: at android.os.AsyncTask$2.call(AsyncTask.java:333)
06-13 20:51:47.801 2070 5153 E DisplayNotificationTask: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
06-13 20:51:47.801 2070 5153 E DisplayNotificationTask: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
06-13 20:51:47.801 2070 5153 E DisplayNotificationTask: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
06-13 20:51:47.801 2070 5153 E DisplayNotificationTask: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
06-13 20:51:47.801 2070 5153 E DisplayNotificationTask: at java.lang.Thread.run(Thread.java:764)

Is there a good way to fix it?

Project Files

iOS

ios/Podfile :

AppDelegate.m :

Android

android/build.gradle :

android/app/build.gradle :

android/settings.gradle :

MainApplication.java :

AndroidManifest.xml :

Environment

react-native info output:

  • Platform that you’re experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
    • e.g. Instance ID
    • Y/N

    Think react-native-firebase is great? Please consider supporting all of the project maintainers and contributors by donating via our Open Collective where all contributors can submit expenses. [Learn More]

    The text was updated successfully, but these errors were encountered:

    @mikehardy is there no possibility to rely on the default small icon?

    Unsure, I set a small icon in all cases where I use it, at least, and it works for me. Based on this issue it seems the opposite won’t 🤷‍♂️

    Well yeah it fixed it for me as well, but I do believe when sending off the recieved notification, that would acctually use a default icon, why would we have to set it again, when there potentially is a default icon.

    Also the error log is not optimal, as it just sends cannot send. But the ADB log clearly states the problem 🙂

    Is there any solution for fixing this problem. Attention : I am using Awesome Notification package in flutter.

    E/Android: Awesome Notifications: Invalid notification (no valid small icon): Notification(channel=basic_channel shortcut=null contentView=null vibrate=null sound=null tick defaults=0x0 flags=0x11 color=0xff009688 vis=PRIVATE) (NotificationThread:58)
    W/System.err(25254): me.carda.awesome_notifications.core.exceptions.AwesomeNotificationsException: Invalid notification (no valid small icon): Notification(channel=basic_channel shortcut=null contentView=null vibrate=null sound=null tick defaults=0x0 flags=0x11 color=0xff009688 vis=PRIVATE)
    W/System.err(25254): at android.app.NotificationManager.fixNotification(NotificationManager.java:606)
    W/System.err(25254): at android.app.NotificationManager.notifyAsUser(NotificationManager.java:585)
    W/System.err(25254): at android.app.NotificationManager.notify(NotificationManager.java:534)
    W/System.err(25254): at android.app.NotificationManager.notify(NotificationManager.java:510)
    W/System.err(25254): at me.carda.awesome_notifications.core.managers.StatusBarManager.showNotificationOnStatusBar(StatusBarManager.java:86)
    W/System.err(25254): at me.carda.awesome_notifications.core.threads.NotificationSender.showNotification(NotificationSender.java:260)
    W/System.err(25254): at me.carda.awesome_notifications.core.threads.NotificationSender.doInBackground(NotificationSender.java:147)
    W/System.err(25254): at me.carda.awesome_notifications.core.threads.NotificationSender.doInBackground(NotificationSender.java:32)
    W/System.err(25254): at me.carda.awesome_notifications.core.threads.NotificationThread.runOnForegroundThread(NotificationThread.java:106)
    W/System.err(25254): at me.carda.awesome_notifications.core.threads.NotificationThread.execute(NotificationThread.java:34)
    W/System.err(25254): at me.carda.awesome_notifications.core.threads.NotificationSender.send(NotificationSender.java:101)
    W/System.err(25254): at me.carda.awesome_notifications.core.AwesomeNotifications.createNotification(AwesomeNotifications.java:569)
    W/System.err(25254): at me.carda.awesome_notifications.AwesomeNotificationsPlugin.channelMethodCreateNotification(AwesomeNotificationsPlugin.java:1274)

    Источник

    Saved searches

    Use saved searches to filter your results more quickly

    You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

    Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

    By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

    Already on GitHub? Sign in to your account

    Unable to start receiver — Invalid notification (no valid small icon): #948

    Unable to start receiver — Invalid notification (no valid small icon): #948

    Comments

    Fatal Exception: java.lang.RuntimeException: Unable to start receiver com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver: java.lang.IllegalArgumentException: Invalid notification (no valid small icon): Notification(channel=so_div_id pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x10 color=0x00000000 vis=PRIVATE semFlags=0x0 semPriority=0 semMissedCount=0) at android.app.ActivityThread.handleReceiver(ActivityThread.java:4125) at android.app.ActivityThread.access$1400(ActivityThread.java:270) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2062) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:237) at android.app.ActivityThread.main(ActivityThread.java:7948) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1075) 

    The text was updated successfully, but these errors were encountered:

    Crashlytics registered 11 failures in 8 different users in the last 7 days. All on Android 10

    FlutterLocalNotificationsPlugin.java line 14

    Fatal Exception: java.lang.RuntimeException: Unable to start receiver com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver: java.lang.IllegalArgumentException: Invalid notification (no valid small icon): Notification(channel=so_div_id pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x10 color=0x00000000 vis=PRIVATE)
    at android.app.ActivityThread.handleReceiver(ActivityThread.java:3797)
    at android.app.ActivityThread.access$1400(ActivityThread.java:219)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1870)
    at android.os.Handler.dispatchMessage(Handler.java:107)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:7356)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:491)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

    If you released your app out to users whilst it had an issue and they scheduled notifications, the fix isn’t going to be applied retroactively. The icon used is what gets specified at the time the notification had been scheduled so if you didn’t set this correctly before and users have existing scheduled notifications, they will continue to have an issue. If that’s what you’ve done then that’s an issue you’ll need to solve within your application.

    Providing crashlytics logs doesn’t necessarily indicate it’s an issue with the plugin either. If you reckon you’ve come across a bug, you’ll need to provide a link to link to a repository with a minimal app that can reproduce this problem

    Closing as this appears to have originally been a configuration issue with no further info provided to indicate that a reproducible bug exists when an app has been configured properly

    Источник

Оцените статью