Приложение Cordova аварийно завершает работу из-за недопустимого уведомления (нет допустимого маленького значка) - PullRequest
0 голосов
/ 25 мая 2020

Я использую плагин фонового режима Cordova и получаю следующую ошибку:

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)

На самом деле в меню верхней панели появляется уведомление - со значком приложения. Эта ошибка приводит к полному краху приложения sh - как это исправить?

...