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

WorkManager Crashes on Android #796

Closed
selected-pixel-jameson opened this issue Jun 17, 2022 · 7 comments
Closed

WorkManager Crashes on Android #796

selected-pixel-jameson opened this issue Jun 17, 2022 · 7 comments

Comments

@selected-pixel-jameson
Copy link

selected-pixel-jameson commented Jun 17, 2022

java.lang.RuntimeException: 
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:4770)
  at android.app.ActivityThread.access$1800 (ActivityThread.java:310)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2292)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loopOnce (Looper.java:226)
  at android.os.Looper.loop (Looper.java:313)
  at android.app.ActivityThread.main (ActivityThread.java:8669)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:571)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1135)
Caused by: java.lang.IllegalStateException: 
  at androidx.work.impl.WorkManagerImpl.getInstance (WorkManagerImpl.java:140)
  at androidx.work.WorkManager.getInstance (WorkManager.java:180)
  at com.onesignal.OSNotificationRestoreWorkManager.beginEnqueueingWork (OSNotificationRestoreWorkManager.java:48)
  at com.onesignal.BootUpReceiver.onReceive (BootUpReceiver.java:38)
  at android.app.ActivityThread.handleReceiver (ActivityThread.java:4761)
@nan-li
Copy link
Contributor

nan-li commented Jun 17, 2022

Hi @selected-pixel-jameson,
Thank you for reporting this crash. Do you have more information on what the IllegalStateException is?
There ideally should be a message about what it is.

@selected-pixel-jameson
Copy link
Author

This is all the information that I'm given.

Screen Shot 2022-06-17 at 1 05 38 PM

@nan-li
Copy link
Contributor

nan-li commented Jun 17, 2022

Seeing that this IllegalStateException is coming from WorkManagerImpl.getInstance
The error message is probably this:

"WorkManager is not initialized properly. You have explicitly disabled WorkManagerInitializer in your manifest, have not manually called WorkManager#initialize at this point, and your Application does not implement Configuration.Provider."

@selected-pixel-jameson
Copy link
Author

The crash specifically calls out Onesignal.

java.lang.IllegalStateException
com.onesignal.OSNotificationRestoreWorkManager.beginEnqueueingWork

Screen Shot 2022-06-28 at 10 30 06 AM

@selected-pixel-jameson
Copy link
Author

This seems to only be happening on Samsung Galaxy Devices.
Screen Shot 2022-06-28 at 10 30 41 AM

@jkasten2 jkasten2 changed the title Causing Crashes on Android WorkManager Crashes on Android Jun 28, 2022
@felicienfrancois
Copy link

felicienfrancois commented Nov 25, 2022

Similar issue here with latest release (3.2.0) compiled with cordova-android 11 and target sdk 33.
Happened on samsung devices + android 11.

java.lang.IllegalStateException: WorkManager is not initialized properly. You have explicitly disabled WorkManagerInitializer in your manifest, have not manually called WorkManager#initialize at this point, and your Application does not implement Configuration.Provider. at androidx.work.impl.WorkManagerImpl.getInstance(WorkManagerImpl.java:158) at androidx.work.WorkManager.getInstance(WorkManager.java:184) at com.onesignal.OSNotificationRestoreWorkManager.beginEnqueueingWork(OSNotificationRestoreWorkManager.java:48) at com.onesignal.OneSignal.handleActivityLifecycleHandler(OneSignal.java:975) at com.onesignal.OneSignal.init(OneSignal.java:852) at com.onesignal.OneSignal.setAppId(OneSignal.java:735) 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:923)

@nan-li
Copy link
Contributor

nan-li commented Jun 20, 2024

Hi all, we made updates to Work Manager in several release, the latest of which are: Release 5.1.15 for the User Model SDK and Release 4.8.10 for the Player Model SDK.

This issue is a bit old, please @ me if you are still experiencing any problems related to Work Manager.

@nan-li nan-li closed this as completed Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants