[Bug]: WorkManager is not initialised properly. not fixed yet
What happened?
I am using one-signal latest unity SDK as i upgraded my SDK due to play store api 31 policy before this everything was fine and now some of my testing devices facing this crash, due to this my release is getting delayed. and why this happening on some of devices why not all? if initialisation of work-manger not effecting latest devices?

Steps to reproduce?
This issue occurs mostly on low end devices when one-signal initialisation starts
What did you expect to happen?
One-signal initialisation success
Unity version
2020.3.42f1
OneSignal Unity SDK version
3.0.7
Platform
Android
Relevant log output
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
@toseefhaiderkhansugguu Thanks for reporting, we have seen a few reports of this been we haven't been able to narrow it down yet. Can you fill out the details on this Github issue to help us? https://github.com/OneSignal/OneSignal-Android-SDK/issues/1672
OneSignal/OneSignal-Android-SDK#1672
Ok sure!
This still happens, non of the workarounds worked. Did you managed to fix it @toseefhaiderkhansugguu ?
@Martin-Gonzalez90 not yet
is it possible to someone from OneSignal team to tell me when this code is being executed based on the stacktrace?
Caused by: 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)
I think I found a workaround, would be nice if you can try this @toseefhaiderkhansugguu just to verify it as well. I added to my gradle dependencies list the following dependency:
api 'androidx.startup:startup-runtime:1.1.1'
Found that this dependency is the one the does something with the workers. Link here
Anyone who is having this issue please update to OneSignal-Unity-SDK 3.0.10 as this should address this issue.
Please report back if updating to this version fixes the issue for you or if you continue to see these same crashes.