Skip to content

Targeting Android 12 is failing because OneSignal is using a WorkManager version < 2.7.0 #1442

@islam-assi

Description

@islam-assi

Description:

I got a runtime crash while trying to run the app targeting Android 12. The crash is related to the WorkManager version that is being used in OneSignal. The WorkManager version is less than 2.7.0. WorkManager 2.7.0-beta01 fixed the issue. Unfortunately, it is not stable yet.

Environment
targetSdkVersion 31
compileSdkVersion 31

Steps to Reproduce Issue:

  1. Add the OneSignal SDK to your project
  2. Change the targetSdkVersion and the compileSdkVersion to 31
  3. Run the app

Anything else:

The WorkManager version used in OneSignal is
api 'androidx.work:work-runtime:[2.0.0, 2.5.99]'

    Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
        at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
        at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:645)
        at android.app.PendingIntent.getBroadcast(PendingIntent.java:632)
        at androidx.work.impl.utils.ForceStopRunnable.getPendingIntent(ForceStopRunnable.java:273)
        at androidx.work.impl.utils.ForceStopRunnable.isForceStopped(ForceStopRunnable.java:151)
        at androidx.work.impl.utils.ForceStopRunnable.forceStopRunnable(ForceStopRunnable.java:171)
        at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:102)
        at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:91)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:920)

WorkManager
Pending intents mutability

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions