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

[CRASH][ANDROID] Attempt to invoke virtual method 'boolean android.app.NotificationChannel.isDeleted()' on a null object reference #1150

Closed
kperreau opened this issue Jan 23, 2021 · 8 comments

Comments

@kperreau
Copy link

kperreau commented Jan 23, 2021

Description:

Crash on Android reported by crashlytics from some users.

Environment
Packages

"react": "16.13.1",
"react-native": "0.63.4",
"react-native-onesignal": "^4.0.3",

Device

Android: 8
Devices: HUAWEI P10 lite,  Sasmung Galaxy S8

Steps to Reproduce Issue:
Receive a push notification OneSignal.
I don't have more informations.

Anything else:

Error

Fatal Exception: java.lang.NullPointerException
Attempt to invoke virtual method 'boolean android.app.NotificationChannel.isDeleted()' on a null object reference

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.readException(Parcel.java:1960)
       at android.os.Parcel.readException(Parcel.java:1900)
       at android.app.INotificationManager$Stub$Proxy.getNotificationChannels(INotificationManager.java:1618)
       at android.app.NotificationManager.getNotificationChannels(NotificationManager.java:515)
       at com.onesignal.NotificationChannelManager.processChannelList(NotificationChannelManager.java:236)
       at com.onesignal.OneSignal$5.complete(OneSignal.java:970)
       at com.onesignal.OneSignalRemoteParams.processJson(OneSignalRemoteParams.java:205)
       at com.onesignal.OneSignalRemoteParams.access$100(OneSignalRemoteParams.java:12)
       at com.onesignal.OneSignalRemoteParams$1.onSuccess(OneSignalRemoteParams.java:150)
       at com.onesignal.OneSignalRestClient$5.run(OneSignalRestClient.java:269)
       at java.lang.Thread.run(Thread.java:784)
@luan-nvg
Copy link

got?

@rgomezp
Copy link
Contributor

rgomezp commented Feb 4, 2021

Howdy,
Thank you so much for the stack trace.

@Jeasmine 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.

We will have to dig into this a bit further.

Thank you for reporting this.

@jfishman1
Copy link

@Jeasmine @rgomezp Another report of this on Native Android SDK com.onesignal:OneSignal:[4.0.0, 4.99.99]
99% of crashes on Samsung Galaxy SM-G950F (Android 9) (1 user only)
Unfortunately don't know steps for reproduce.

1 - Tried disabling an app group on my device and sending push, but did not crash.
2 - Tried saving the android_channel_id to my api requests, delete the id, no crash
3 - Tried renaming the android_channel_id, no change

@kperreau @luan-nvg any other ideas on what you tried to help us reproduce?

Are you using custom android channel ids or OneSignal android channel ids?

@bobbyirawan09
Copy link

Hi there, I also got the same problem but my app running on Native Android SDK, no open issue there so I'll comment here. Here is some information regarding the issue that happens to me:

  1. OneSignal SDK is 4.0.0
  2. Device is Android 9, Oppo Realme C1, 90% happens on background, currently, 87 events occurred, and only this user
  3. Don't know how to reproduce since it's a very small user, and we don't have the device to test
  4. The code part that causing the problem is the same as @rgomezp mentioned before

Is there's anything I can do to maybe handle or catch it for now? Quite worrying to see the occurrence of the crash, thank you

@kperreau
Copy link
Author

kperreau commented Mar 2, 2021

Any news ? I got some bad review on Play Store because of this crash.
Samsung S8 user (Android 9) got instant crash at startup.

@jfishman1 I'm using custom android channel ids.

@ramanbindal
Copy link

Hi there,
I got the same problem. One user got around 218 crashes in one single day in Crashlytics.
Device brand - Oppo
Os version - 9
Stack trace-
com.onesignal.NotificationChannelManager.processChannelList
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.app.NotificationChannel.isDeleted()' on a null object reference

Is there any solution yet?

@ramanbindal
Copy link

Hi @rgomezp ,
Any update on this yet? Got around 2-3k crashes to date from this issue. My Crashlytics reports are messed up because of this. Please provide a solution.

@rgomezp
Copy link
Contributor

rgomezp commented Mar 30, 2021

Duplicate of OneSignal/OneSignal-Android-SDK#1291

@rgomezp rgomezp marked this as a duplicate of #1150 Mar 30, 2021
@rgomezp rgomezp closed this as completed Mar 30, 2021
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

6 participants