Skip to content

[Bug]: WorkManager crash on OneSignal 4.8.9 #2078

@bundleberk

Description

@bundleberk

What happened?

I am using onesignal 4.8.9 and workmanager 2.8.1. I'm disabling workmanager initializer in my manifest because im using a custom workmanager configuration for setting the hilt worker factory. I am not initializing workmanager myself. I am seeing this crash in crashlytics and it is not rare, happens a lot.

We cannot upgrade to onesignal 5.x.x because of a bug that causes unresponsive notifications on xiaomi devices. So we are kind of stuck here.

Fatal Exception: java.lang.IllegalStateException: WorkManager is already initialized. Did you try to initialize it manually without disabling WorkManagerInitializer? See WorkManager#initialize(Context, Configuration) or the class level Javadoc for more information. at androidx.work.impl.WorkManagerImpl.initialize(WorkManagerImpl.java:200) at androidx.work.WorkManager.initialize(WorkManager.java:210) at com.onesignal.OSWorkManagerHelper.getInstance(OSWorkManagerHelper.kt:62) at com.onesignal.OSNotificationWorkManager.beginEnqueueingWork(OSNotificationWorkManager.java:66) at com.onesignal.NotificationBundleProcessor$3.onResult(NotificationBundleProcessor.java:423) at com.onesignal.OSNotificationDataController$5.run(OSNotificationDataController.java:242) at java.lang.Thread.run(Thread.java:923)

Any solutions?

Steps to reproduce?

Cannot reproduce

What did you expect to happen?

I expect no crashes

OneSignal Android SDK version

Release 4.8.9

Android version

13, 12, 11, 10, 9, 8, 7.1, 7.0

Specific Android models

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions