[Bug]: submit a null runnable to pendingTaskExecutor
What happened?
Fatal Exception: java.lang.NullPointerException:
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:116)
at java.util.concurrent.Executors$DelegatedExecutorService.submit(Executors.java:640)
at com.onesignal.OSTaskController.startPendingTasks(OSTaskController.java:92)
at com.onesignal.OneSignal.init(OneSignal.java:878)
at com.onesignal.OneSignal.setAppId(OneSignal.java:730)
at com.onesignal.OneSignal.reassignDelayedInitParams(OneSignal.java:1174)
at com.onesignal.OneSignal.onRemoteParamSet(OneSignal.java:882)
at com.onesignal.OneSignal$7.complete(OneSignal.java:1115)
at com.onesignal.OneSignalRemoteParams.processJson(OneSignalRemoteParams.java:206)
at com.onesignal.OneSignalRemoteParams.access$100(OneSignalRemoteParams.java:12)
at com.onesignal.OneSignalRemoteParams$1.onSuccess(OneSignalRemoteParams.java:151)
at com.onesignal.OneSignalRestClient$5.run(OneSignalRestClient.java:292)
at java.lang.Thread.run(Thread.java:920)

Steps to reproduce?
have no idea how to reproduce
What did you expect to happen?
fix the bug
OneSignal Android SDK version
Release 4.7.2
Android version
12
Specific Android models
No response
Relevant log output
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
@CharlieZheng Thank you for reporting we will investigate! Any info you can think of to help reproduce the issue would be appreciated. In the mean time I recommend updating to the latest version of the SDK.
I think I have the same issue:
Non-fatal Exception: java.lang.Exception AndroidJavaException : java.lang.NullPointerException java.util.concurrent.AbstractExecutorService.submit (java.util.concurrent.AbstractExecutorService) java.util.concurrent.Executors$DelegatedExecutorService.submit (java.util.concurrent.Executors$DelegatedExecutorService) com.onesignal.OSTaskController.startPendingTasks (com.onesignal.OSTaskController) com.onesignal.OneSignal.init (com.onesignal.OneSignal) com.onesignal.OneSignal.setAppId (com.onesignal.OneSignal) com.onesignal.OneSignal.reassignDelayedInitParams (com.onesignal.OneSignal) com.onesignal.OneSignal.provideUserConsent (com.onesignal.OneSignal) com.unity3d.player.UnityPlayer.nativeRender (com.unity3d.player.UnityPlayer) com.unity3d.player.UnityPlayer.access$300 (com.unity3d.player.UnityPlayer) com.unity3d.player.UnityPlayer$e$1.handleMessage (com.unity3d.player.UnityPlayer$e$1) android.os.Handler.dispatchMessage (android.os.Handler) android.os.Looper.loopOnce (android.os.Looper) android.os.Looper.loop (android.os.Looper) com.unity3d.player.UnityPlayer$e.run (com.unity3d.player.UnityPlayer$e) UnityEngine.AndroidJNISafe.CheckException (UnityEngine.AndroidJNISafe) UnityEngine.AndroidJavaObject._CallStatic (UnityEngine.AndroidJavaObject) OneSignalSDK.OneSignalAndroid.set_PrivacyConsent (OneSignalSDK.OneSignalAndroid) OneSignalInit.ReceivedUserConsent (OneSignalInit) Hyperbyte.ConsentSetting.OnContinueButtonPressed (Hyperbyte.ConsentSetting) UnityEngine.Events.UnityAction.Invoke (UnityEngine.Events.UnityAction) UnityEngine.Events.UnityEvent.Invoke (UnityEngine.Events.UnityEvent) UnityEngine.EventSystems.ExecuteEvents+EventFunction1[T1].Invoke (UnityEngine.EventSystems.ExecuteEvents+EventFunction1[T1]) UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.EventSystems.ExecuteEvents) UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchPress (UnityEngine.EventSystems.StandaloneInputModule) UnityEngine.EventSystems.StandaloneInputModule.ProcessTouchEvents (UnityEngine.EventSystems.StandaloneInputModule) UnityEngine.EventSystems.StandaloneInputModule.Process (UnityEngine.EventSystems.StandaloneInputModule) UnityEngine.EventSystems.StandaloneInputModule:Process (UnityEngine.EventSystems)
Unity 2020.3.47f1 (64-bit) OneSignal 3.0.10 Happens on Andoid devices. As you can see in the stack trace it is conected to providing user consent: "provideUserConsent". Try to provide consent after initialization of OneSignal in several seconds.
Hey 👋
Same crash reports here:
Fatal Exception: java.lang.NullPointerException:
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:116)
at java.util.concurrent.Executors$DelegatedExecutorService.submit(Executors.java:640)
at com.onesignal.OSTaskController.startPendingTasks(OSTaskController.java:92)
at com.onesignal.OneSignal.init(OneSignal.java:885)
at com.onesignal.OneSignal.setAppId(OneSignal.java:737)
at com.onesignal.OneSignal.reassignDelayedInitParams(OneSignal.java:1181)
at com.onesignal.OneSignal.onRemoteParamSet(OneSignal.java:889)
at com.onesignal.OneSignal$7.complete(OneSignal.java:1122)
at com.onesignal.OneSignalRemoteParams.processJson(OneSignalRemoteParams.java:211)
at com.onesignal.OneSignalRemoteParams.access$100(OneSignalRemoteParams.java:12)
at com.onesignal.OneSignalRemoteParams$1.onSuccess(OneSignalRemoteParams.java:156)
at com.onesignal.OneSignalRestClient$5.run(OneSignalRestClient.java:279)
at java.lang.Thread.run(Thread.java:922)
happening on both 4.8.4 and 4.8.6 versions of the SDK. 99% of impacted devices are on Android 12, otherwise Android 11.
@HappyDr0id Thank you for the info have you been able to reproduce the crash in testing at all?
@emawby No I didn't reproduce it on my side, that's the kind of error reported in Crashlytics but quite hard to spot on a few dev devices. And since I don't have any knowledge about the internal functioning of the SDK, that's even harder to reproduce.
Getting also this crash with users of V2120 (vivo Y15s) using version 4.8.6.
Hello everyone! Apologies that this issue has gone stale. Much of our work in the last few quarters have been on a new major release where many improvements and enhancements are introduced. We will continue to investigate 4.x.x bugs, though we encourage you to update to our latest release as that will be the most-supported release going forward. Please see our migration guide for full details on upgrading.
If this crash is still a concern for you, please let us know and we will investigate further. Thanks!
This issue isn't present in the 5.x.x major release. If you are still on 4.x.x and can't update yet there is now a fix available in 4.8.8.
It looks like there is a bug with ConcurrentLinkedQueue in Android 12 specifically:
- https://github.com/laurent22/joplin/issues/8425#issuecomment-1636682697
- https://issuetracker.google.com/issues/261481042
In order for this to be solved for 4.x.x of this SDK we will need to replace all usages of ConcurrentLinkedQueue with something else.
The 5.x.x of this SDK doesn't use this, so upgrading to this version will solve this issue today for you.
In addition to this not being an issue in 5.x.x versions, this is now fixed in 4.8.9.