You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Exoplayer WorkManager Extension is not compatible with Android 12 #9181
There is a behavior change in Android 12 which requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent if the app is targeting Android 12.
Current stable version (2.5.0) of WorkManager don’t have these flags, and so it affects all apps directly, or indirectly using WorkManager.
Apps will throw the following exception in runtime
Fatal Exception: java.lang.IllegalArgumentException: com.sample.packagename: Targeting S+ (version 10000 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent. 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:386) at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:657) at android.app.PendingIntent.getBroadcast(PendingIntent.java:644) at androidx.work.impl.utils.ForceStopRunnable.getPendingIntent(ForceStopRunnable.java:174) at androidx.work.impl.utils.ForceStopRunnable.isForceStopped(ForceStopRunnable.java:108) at androidx.work.impl.utils.ForceStopRunnable.run(ForceStopRunnable.java:86) at androidx.work.impl.utils.SerialExecutor$Task.run(SerialExecutor.java:75) 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)
Developer could manually adding the a compatible version of WorkManager (e.g. 2.7.0-alpha04) in their build.gradle file as workaround
implementation 'com.google.android.exoplayer:extension-workmanager:2.X.X'
// For apps targeting Android 12, add the following
constraints {
implementation 'androidx.work:work-runtime:2.7.0-alpha04'
}
Issue is on current version of ExoPlayer WorkManager Extension (2.14.1)
Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
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 com.google.android.gms.cast.framework.media.internal.zzm.zza(com.google.android.gms:play-services-cast-framework@@19.0.0:46)
at com.google.android.gms.cast.framework.CastSession$zza.onResult(com.google.android.gms:play-services-cast-framework@@19.0.0:11)
Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
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 com.google.android.gms.internal.cast.zzch.zzb(com.google.android.gms:play-services-cast@@20.0.0:1)
It should now be straightforward for applications to work around this problem by adding an explicit dependency on implementation 'androidx.work:work-runtime:2.7.0' in the application build.gradle. We will also be updating ExoPlayer's WorkManager extension to depend on this WorkManager release.
Activity
ojw28 commentedon Jul 13, 2021
We will also update ExoPlayer to use
2.7.0once it's stable.clhols commentedon Jul 30, 2021
Also an issue with the cast extension:
clhols commentedon Jul 30, 2021
Forcing play-services-cast-framework:20.0.0 doesn't fix it:
seventhmoon commentedon Aug 4, 2021
@clhols this is not related to this bug (Exoplayer WorkManager Extension).
Have you submit the issue to issuetracker?
seventhmoon commentedon Sep 8, 2021
WorkManager
2.7.0-beta01is released.https://developer.android.com/jetpack/androidx/releases/work#2.7.0-beta01
ojw28 commentedon Oct 13, 2021
It should now be straightforward for applications to work around this problem by adding an explicit dependency on
implementation 'androidx.work:work-runtime:2.7.0'in the applicationbuild.gradle. We will also be updating ExoPlayer's WorkManager extension to depend on this WorkManager release.Upgrade to WorkManager release compatible with Android 12