Onesignal-android-sdk: NullPointerException from PersistableBundle.getString - `An error occurred while executing doInBackground`

Created on 9 Oct 2019  路  7Comments  路  Source: OneSignal/OneSignal-Android-SDK

OneSignal version 3.11.4

We send Push Message without Title, some clients have this error:

Stacktrace:

Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.os.PersistableBundle.getString(java.lang.String)' on a null object reference
       at com.onesignal.BundleCompatPersistableBundle.getString(BundleCompat.java:91)
       at com.onesignal.NotificationBundleProcessor.ProcessFromGCMIntentService(NotificationBundleProcessor.java:66)
       at com.onesignal.GcmIntentJobService.onHandleWork(GcmIntentJobService.java:21)
       at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:391)
       at android.support.v4.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:382)
       at android.os.AsyncTask$2.call(AsyncTask.java:333)
       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
       at java.lang.Thread.run(Thread.java:764)

image

Help Wanted Possible Bug

Most helpful comment

I have this, many crashes on Android 8+
implementation 'com.onesignal:OneSignal:3.12.3'
trace
os

All 7 comments

Which Samsung devices are you seeing this on?

Closing due to no response

sent a notification and app crashes again and again
cant even open weburl sent

Process: com.oxoo.spagreen, PID: 423 java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.json.JSONObject.getString(java.lang.String)' on a null object reference at com.oxoo.spagreen.NotificationClickHandler.notificationOpened(NotificationClickHandler.java:35) at com.onesignal.OneSignal$18.run(OneSignal.java:1954) at com.onesignal.OSUtils.runOnMainUIThread(OSUtils.java:278) at com.onesignal.OneSignal.fireNotificationOpenedHandler(OneSignal.java:1951) at com.onesignal.OneSignal.runNotificationOpenedCallback(OneSignal.java:1900) at com.onesignal.OneSignal.handleNotificationOpen(OneSignal.java:1991) at com.onesignal.NotificationOpenedProcessor.processIntent(NotificationOpenedProcessor.java:118) at com.onesignal.GenerateNotification$1$1.onClick(GenerateNotification.java:146) at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:184) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7076) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965) I/Process: Sending signal. PID: 423 SIG: 9 Application terminated.

@saranshbalyan-1234 ,
That seems like a different issue. Please open its own thread and follow our issue template. Cheers

I have this, many crashes on Android 8+
implementation 'com.onesignal:OneSignal:3.12.3'
trace
os

Capture

I am also facing the same issue.

Was this page helpful?
0 / 5 - 0 ratings