Skip to content
New issue

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

Fatal Exception: 'boolean android.app.NotificationChannel.isDeleted() #1291

Closed
DaxeshV opened this issue Mar 13, 2021 · 17 comments
Closed

Fatal Exception: 'boolean android.app.NotificationChannel.isDeleted() #1291

DaxeshV opened this issue Mar 13, 2021 · 17 comments

Comments

@DaxeshV
Copy link

DaxeshV commented Mar 13, 2021

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.app.NotificationChannel.isDeleted()' on a null object reference
at android.os.Parcel.readException(Parcel.java:2035)
at android.os.Parcel.readException(Parcel.java:1975)
at android.app.INotificationManager$Stub$Proxy.getNotificationChannels(INotificationManager.java:1824)
at android.app.NotificationManager.getNotificationChannels(NotificationManager.java:483)
at com.onesignal.NotificationChannelManager.processChannelList(NotificationChannelManager.java:49)
at com.onesignal.OneSignal$5.complete(OneSignal.java:36)
at com.onesignal.OneSignalRemoteParams.processJson(OneSignalRemoteParams.java:10)
at com.onesignal.OneSignalRemoteParams.access$100(OneSignalRemoteParams.java)
at com.onesignal.OneSignalRemoteParams$1.onSuccess(OneSignalRemoteParams.java:2)
at com.onesignal.OneSignalRestClient$5.run(OneSignalRestClient.java:4)
at java.lang.Thread.run(Thread.java:764)

@jkasten2
Copy link
Member

@DaxeshV Thanks for reporting, could you provide the following details as well?

  1. Device models with Android version.
  2. Number of crashes and users affected.
  3. Steps to reproduce the crash.

@codingbeautifully
Copy link

codingbeautifully commented Mar 15, 2021

I also encountered this problem.

This is Stack Trace.

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.app.NotificationChannel.isDeleted()' on a null object reference
at android.os.Parcel.createException(Parcel.java:1972)
at android.os.Parcel.readException(Parcel.java:1934)
at android.os.Parcel.readException(Parcel.java:1884)
at android.app.INotificationManager$Stub$Proxy.getNotificationChannels(INotificationManager.java:2158)
at android.app.NotificationManager.getNotificationChannels(NotificationManager.java:568)
at com.onesignal.NotificationChannelManager.processChannelList(NotificationChannelManager.java:236)
at com.onesignal.OneSignal$5.complete(OneSignal.java:1072)
at com.onesignal.OneSignalRemoteParams.processJson(OneSignalRemoteParams.java:188)
at com.onesignal.OneSignalRemoteParams.access$100(OneSignalRemoteParams.java:12)
at com.onesignal.OneSignalRemoteParams$1.onSuccess(OneSignalRemoteParams.java:140)
at com.onesignal.OneSignalRestClient$5.run(OneSignalRestClient.java:270)
at java.lang.Thread.run(Thread.java:764)

Details

  1. Device models with Android version.

100% are oppo phones

79% oppo phone versions are Android 9.
21% oppo phone versions are Android 8.

  1. Number of crashes and users affected.

This issue has 396 crash events affecting 14 users.

  1. Steps to reproduce the crash.

We don't have oppo phones so we can't reproduce the crash.

@es0329
Copy link

es0329 commented Mar 25, 2021

  • On March 25th 2021, this issue began appearing in 68 crash events impacting 3 users
  • 100% of occurrences are observed on Oppo devices running API 28 (Android 9)
  • The effected release of our app depends on OneSignal-Android-SDK version 3.15.3
  • Steps to reproduce are unknown
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.app.NotificationChannel.isDeleted()' on a null object reference
       at android.os.Parcel.createException(Parcel.java:1972)
       at android.os.Parcel.readException(Parcel.java:1934)
       at android.os.Parcel.readException(Parcel.java:1884)
       at android.app.INotificationManager$Stub$Proxy.getNotificationChannels(INotificationManager.java:2158)
       at android.app.NotificationManager.getNotificationChannels(NotificationManager.java:568)
       at com.onesignal.NotificationChannelManager.processChannelList(NotificationChannelManager.java:236)
       at com.onesignal.OneSignal$5.complete(OneSignal.java:1071)
       at com.onesignal.OneSignalRemoteParams.processJson(OneSignalRemoteParams.java:188)
       at com.onesignal.OneSignalRemoteParams.access$100(OneSignalRemoteParams.java:12)
       at com.onesignal.OneSignalRemoteParams$1.onSuccess(OneSignalRemoteParams.java:140)
       at com.onesignal.OneSignalRestClient$5.run(OneSignalRestClient.java:270)
       at java.lang.Thread.run(Thread.java:764)

@jennantilla
Copy link
Contributor

Hi @DaxeshV

Looking at your stack trace, are you doing anything with notification channels?

According to other reports, this is crash appears to be specific to Android 8+ Oppo devices. Is that the case with you as well? If so have you attempted to address this issue with the device manufacturer?

A potential workaround you could try is not initializing OneSignal on Oppo devices.

String deviceName = android.os.Build.MODEL;
String deviceMan = android.os.Build.MANUFACTURER;

If you have any additional info that hasn't been provided previously, please share here.

@DaxeshV
Copy link
Author

DaxeshV commented Mar 29, 2021

Hi @DaxeshV

Looking at your stack trace, are you doing anything with notification channels?

According to other reports, this is crash appears to be specific to Android 8+ Oppo devices. Is that the case with you as well? If so have you attempted to address this issue with the device manufacturer?

A potential workaround you could try is not initializing OneSignal on Oppo devices.

String deviceName = android.os.Build.MODEL;
String deviceMan = android.os.Build.MANUFACTURER;

If you have any additional info that hasn't been provided previously, please share here.

  • In my side crash report showing 180 crash happen within 48 hrs and 50 % Xiaomi devices , 42 % OPPO and 8 % Samsung devices. In android 8 98% crash and android 9 have 2% Crash happen. All are non rooted devices. Before it working fine crash start in 4.2.0 version.

Please check below link of firebase crash report.
https://prnt.sc/10z222p
https://prnt.sc/10z232f

@rgomezp
Copy link
Contributor

rgomezp commented Mar 30, 2021

@Jeasmine, @jkasten2 coming from here.

From a surface-level it seems that the OneSignal Notification Manager is tracking references to channels that at some point get deleted and are thus null.

@ramanbindal
Copy link

hi @rgomezp , do we have any fix to this issue yet?

@rgomezp
Copy link
Contributor

rgomezp commented Apr 9, 2021

Howdy,
Nothing yet. Thanks for your patience.

@janbolat
Copy link

We have the same problem (NotificationChannelManager.java:236).
Try/catch maybe? :)
image

@ZakariaEsbaiy
Copy link

ZakariaEsbaiy commented Apr 11, 2021

This issue has 85 crash events affecting 2 users for the last 2 hours

Stack trace:
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.app.NotificationChannel.isDeleted()' on a null object reference
at android.os.Parcel.createException(Parcel.java:1972)
at android.os.Parcel.readException(Parcel.java:1934)
at android.os.Parcel.readException(Parcel.java:1884)
at android.app.INotificationManager$Stub$Proxy.getNotificationChannels(INotificationManager.java:2158)
at android.app.NotificationManager.getNotificationChannels(NotificationManager.java:568)
at com.onesignal.NotificationChannelManager.processChannelList(NotificationChannelManager.java:53)
at com.onesignal.OneSignal$5.complete(OneSignal.java:53)
at com.onesignal.OneSignalRemoteParams.processJson(OneSignalRemoteParams.java:53)
at com.onesignal.OneSignalRemoteParams.access$100(OneSignalRemoteParams.java:53)
at com.onesignal.OneSignalRemoteParams$1.onSuccess(OneSignalRemoteParams.java:53)
at com.onesignal.OneSignalRestClient$5.run(OneSignalRestClient.java:4)
at java.lang.Thread.run(Thread.java:764)

Caused by android.os.RemoteException
Caused by android.os.RemoteException: Remote stack trace:
at com.android.server.notification.RankingHelper.getNotificationChannels(RankingHelper.java:1135)
at com.android.server.notification.NotificationManagerService$10.getNotificationChannels(NotificationManagerService.java:2613)
at android.app.INotificationManager$Stub.onTransact(INotificationManager.java:432)
at com.android.server.notification.NotificationManagerService$10.onTransact(NotificationManagerService.java:2094)
at android.os.Binder.execTransact(Binder.java:731)

Device status: 93% In background

Device:
Brand:OPPO
Model:A1k
Orientation: Portrait
RAM free: 704.46 MB
Disk free: 2.8 GB

Operating System:
Version:9
Orientation: Portrait
Rooted:No
Crash Date:11 Apr 2021, 18:17:08

Untitled
Untitled2

@novanto
Copy link

novanto commented Apr 13, 2021

I'm getting same errors with others. Looks like it's specific on Oppo Devices - specifically on A1K. Error stack trace same as above so I'm not attaching the stack traces.

image

@DaxeshV
Copy link
Author

DaxeshV commented Apr 15, 2021

@Jeasmine don't forgot we subscribe paid plan of one signal. and this typo of issue not accepted. Humble request please fix this issue asap.

@Jeasmine
Copy link
Contributor

We had the fix released under https://github.com/OneSignal/OneSignal-Android-SDK/releases/tag/4.3.1

@janbolat
Copy link

janbolat commented Jun 7, 2021

@Jeasmine Do you have any plans to port it to 3.x?

@jkasten2
Copy link
Member

jkasten2 commented Jun 7, 2021

@janbolat Are there any blockers for you to update to the latest 4.x.x branch of the OneSignal-Android-SDK? If so feel free to create an issue and at me and I can follow up.
For most projects it only takes a few steps to upgrade to the latest by following this guide:
https://documentation.onesignal.com/docs/step-by-step-android-native-3x-to-400-upgrade-guide

We are minimizing the number of fixes for the 3.x.x branch to critical issues that are widespread and security fixes. Since this is affecting a limited number of specific Oppo devices on a specific ROM version we are not planning to backport the fix from 4.x.x to 3.x.x.

@janbolat
Copy link

janbolat commented Jun 8, 2021

@jkasten2 Thank you.
Will update to 4.x

@Jeasmine
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests