OneSignal-Unity-SDK icon indicating copy to clipboard operation
OneSignal-Unity-SDK copied to clipboard

[Bug]: WorkManager is not initialised properly. not fixed yet

Open toseefhaiderkhansugguu opened this issue 3 years ago • 7 comments

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?

Screenshot 2022-11-30 at 5 00 08 PM

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 avatar Dec 01 '22 08:12 toseefhaiderkhansugguu

@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

jkasten2 avatar Dec 01 '22 09:12 jkasten2

OneSignal/OneSignal-Android-SDK#1672

Ok sure!

toseefhaiderkhansugguu avatar Dec 01 '22 10:12 toseefhaiderkhansugguu

This still happens, non of the workarounds worked. Did you managed to fix it @toseefhaiderkhansugguu ?

Martin-Gonzalez90 avatar Feb 07 '23 09:02 Martin-Gonzalez90

@Martin-Gonzalez90 not yet

toseefhaiderkhansugguu avatar Feb 07 '23 10:02 toseefhaiderkhansugguu

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)

Martin-Gonzalez90 avatar Feb 07 '23 10:02 Martin-Gonzalez90

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

Martin-Gonzalez90 avatar Feb 13 '23 07:02 Martin-Gonzalez90

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.

jkasten2 avatar Apr 28 '23 05:04 jkasten2