-
Notifications
You must be signed in to change notification settings - Fork 61
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
[Bug]: WorkManager is not initialized properly. #507
Comments
I see the same issue in our Firebase Crashlytics on nova 3i (Android 9). Fatal Exception: 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:968)
at com.onesignal.OneSignal.init(OneSignal.java:845)
at com.onesignal.OneSignal.setAppId(OneSignal.java:728)
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:784) |
Still have this error. I tried 3.0.3 and 3.0.4.
How can I fix the issue? |
Steps to reproduce:
|
Same, I created one but I guess is the same issue |
Thanks for reporting, we looking for additional details to narrow down the cause of this issue. Can you fill out the requested details on this Github issue so we can try to find the root cause? |
Either create and test "custom WorkManagerInitializer" by yourself, or give us an example script to use in Unity (not in Android Studio). We will test it and will give you results. For you and other people who are facing same crashes. |
How can i create "custom WorkManagerInitializer" in unity at runtime? before One-singnal initialisation. |
@toseefhaiderkhansugguu check the link provided by @jkasten2 and ask him once again. As I see more people (like me) don't understand how to fix or at least try to fix the issue. |
Has anybody tried to increase the initOrder in the WorkerManagerInitializer? I had not time to test it
|
@Martin-Gonzalez90 it doesn't fix the issue. |
try to initialize One Signal after all of your app Start methods you will see some improvements, I haven't seen any crashes today but still not satisfied its not a solution :/ |
@toseefhaiderkhansugguu Thanks for letting us know you can sometimes reproduce the issue, this is key since we haven't seen anyone reproduce the issue themselves (only seen end-user crash reports). Could you share your FULL logcat (with VERBOSE logging).
If you don't see this line, that is ok, please still post the full logcat. Please also feel free to reach out to OneSignal support team referencing this issue and including your full logcat. |
Logcat results you mean unity android logcat results? I dont know how to use android studio i can only share unity android logcat result |
@toseefhaiderkhansugguu There are a few ways to get the full logcat.
|
Can you please provide your email ? i manged to reproduce this crash i want to share logical results |
Hi @toseefhaiderkhansugguu, thanks so much. You can email [email protected] and reference this issue. |
Check Email |
@toseefhaiderkhansugguu Thanks for the logs! I do not see "Initializing WorkManager with default configuration." or any other WorkManager before the "WorkManager is not initialized properly" crash. I see other debug log entries so I think you captured everything correctly. Can you let us know the following details?
|
|
Thanks for the logs, I see the built <provider
android:name="androidx.startup.InitializationProvider"
android:authorities="com.package.example.androidx-startup"
android:exported="false" >
<meta-data
android:name="androidx.work.WorkManagerInitializer"
android:value="androidx.startup" />
<meta-data
android:name="androidx.lifecycle.ProcessLifecycleInitializer"
android:value="androidx.startup" />
</provider> (if this was missing it would have an issue on all devices). We don't have these specific tests to test with. I suspect the issue might be specific to a range of models. Would it be possible to also provide:
|
|
@jkasten2 Tested same scenario on HUAWEI for hours and I am not able to re produce crash on it I don't know what is happening.. what should we do next ? |
@toseefhaiderkhansugguu I took a look but didn't see anything (even Oppo specific log entries) that would relate to providers or workmanger. It is still unknown why we are not seeing "Initializing WorkManager with default configuration." in your logs. Possibly related errorsI do however see some other errors like this on your app startup they could be causing an issue.
Also:
Next Steps@toseefhaiderkhansugguu |
@jkasten2 can you please tell me Firebase Messaging package is necessary for One-signal push notification? |
@toseefhaiderkhansugguu OneSignal does not need the Unity Firebase Messaging package. You can remove it if you don't need it.
|
Has anyone fixed this issue or have any updates from the devs? |
@Mustafax06 we added a speculative workaround to the "WorkManager is not initialized" issue in OneSignal-Unity-SDK 3.0.10.
We haven't see any new reports of "not initialized" errors since then, however different but similar error "already initialized" has come up since then. Have you updated to OneSignal-Unity-SDK 3.0.10 or newer and still seeing this issue? |
Hi all, we made updates to Work Manager in Release 5.1.15 for the User Model SDK and Release 4.8.10 for the Player Model SDK. |
Need update for version 3.x.x |
What happened?
Th latest SDK version 3.0.2 gives me such error:
Non-fatal Exception: java.lang.Exception
AndroidJavaException : 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.
Steps to reproduce?
What did you expect to happen?
Not to have this error
Unity version
2020.3.34
OneSignal Unity SDK version
3.0.2
Platform
Android
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: