EddyVerbruggen / nativescript-local-notifications

:mailbox: NativeScript plugin to easily schedule local notifications
MIT License
162 stars 57 forks source link

Fatal Exception: android.app.RemoteServiceException #161

Open max-pro opened 5 years ago

max-pro commented 5 years ago

I was getting an error from firebase Crashlytics.

Fatal Exception: android.app.RemoteServiceException: Bad notification posted from package com.test.id: Couldn't create icon: StatusBarIcon(icon=Icon(typ=RESOURCE pkg=com.test.id id=0x7f0b0003) visible user=0 ) at android.app.ActivityThread$H.handleMessage + 1881(ActivityThread.java:1881) at android.os.Handler.dispatchMessage + 105(Handler.java:105) at android.os.Looper.loop + 164(Looper.java:164) at android.app.ActivityThread.main + 6944(ActivityThread.java:6944) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.Zygote$MethodAndArgsCaller.run + 327(Zygote.java:327) at com.android.internal.os.ZygoteInit.main + 1374(ZygoteInit.java:1374)

EddyVerbruggen commented 5 years ago

Any idea where that comes from, how to reproduce i, and fix it?

max-pro commented 5 years ago

There are multiple issues in firebase regarding RemoteServiceException, we are not able to reproduce these issue.

max-pro commented 5 years ago
Fatal Exception: java.lang.RuntimeException: Unable to start receiver com.telerik.localnotifications.NotificationAlarmReceiver: java.lang.IllegalArgumentException: Invalid notification (no valid small icon): Notification(channel=Notifications pri=0 contentView=null vibrate=null sound=null tick defaults=0x0 flags=0x10 color=0x00000000 vis=PRIVATE)
       at android.app.ActivityThread.handleReceiver + 3389(ActivityThread.java:3389)
       at android.app.ActivityThread.access$1200 + 200(ActivityThread.java:200)
       at android.app.ActivityThread$H.handleMessage + 1662(ActivityThread.java:1662)
       at android.os.Handler.dispatchMessage + 106(Handler.java:106)
       at android.os.Looper.loop + 193(Looper.java:193)
       at android.app.ActivityThread.main + 6692(ActivityThread.java:6692)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run + 493(RuntimeInit.java:493)
       at com.android.internal.os.ZygoteInit.main + 858(ZygoteInit.java:858)

Firebase stack trace

EddyVerbruggen commented 5 years ago

@max-pro Can you go into node_modules/nativescript-local-notifications and add console.log("icon: " + options.icon) right before and after this line? Then schedule a new notification and report back what is logged.

max-pro commented 5 years ago

icon: res://ic_launcher icon: 2131231023

EddyVerbruggen commented 5 years ago

@max-pro Thx.. then I don't see why that error should pop up.. hmm.. are you sure this is the notifications that triggered the error in Firebase?

max-pro commented 5 years ago

As I tested com.telerik.localnotifications.NotificationAlarmReceiver class showing an error in the background when we call cancel notification logic after restarts mobile.