Cordova app is getting crashed due to Invalid notification (no valid small icon)

0

I am using Cordova background mode plugin, and got the next error:

E/PluginManager: Uncaught exception from plugin
    java.lang.IllegalArgumentException: Invalid notification (no valid small icon): Notification(channel=cordova-plugin-background-mode-id pri=-2 contentView=null vibrate=null sound=null defaults=0x0 flags=0x2 color=0x00000000 vis=PRIVATE)
        at android.app.NotificationManager.fixNotification(NotificationManager.java:522)
        at android.app.NotificationManager.notifyAsUser(NotificationManager.java:501)
        at android.app.NotificationManager.notify(NotificationManager.java:450)
        at android.app.NotificationManager.notify(NotificationManager.java:426)
        at de.appplant.cordova.plugin.background.ForegroundService.updateNotification(ForegroundService.java:249)
        at de.appplant.cordova.plugin.background.BackgroundMode.updateNotification(BackgroundMode.java:227)
        at de.appplant.cordova.plugin.background.BackgroundMode.configure(BackgroundMode.java:196)
        at de.appplant.cordova.plugin.background.BackgroundMode.execute(BackgroundMode.java:99)
        at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:98)
        at org.apache.cordova.PluginManager.exec(PluginManager.java:132)
        at org.apache.cordova.CordovaBridge.jsExec(CordovaBridge.java:59)
        at org.apache.cordova.engine.SystemExposedJsApi.exec(SystemExposedJsApi.java:41)
        at android.os.MessageQueue.nativePollOnce(Native Method)
        at android.os.MessageQueue.next(MessageQueue.java:336)
        at android.os.Looper.loop(Looper.java:174)
        at android.os.HandlerThread.run(HandlerThread.java:67)

Actually there is notification appears in the top bar menu - with the app icon. This error leads to full app crash - how to fix this?

android
cordova
asked on Stack Overflow May 25, 2020 by Raz

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0