Skip to content
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

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

Closed
islam-assi opened this issue Sep 28, 2021 · 1 comment · Fixed by #1477
Closed

Comments

@islam-assi
Copy link

islam-assi commented Sep 28, 2021

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

@jkasten2
Copy link
Member

jkasten2 commented Oct 5, 2021

@islam-assi Thanks for reporting, I see Android now has a 2.7.0-rc01 version now. We will look into upgrading to this soon.

In the meantime you can use this version in your app by simply adding it to your app/build.gradle.

api 'androidx.work:work-runtime:2.7.0-rc01'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants