oppia / oppia-android

A free, online & offline learning platform to make quality education accessible for all.
https://www.oppia.org
Apache License 2.0
298 stars 502 forks source link

[BUG]: Play Console warns about unspecified mutability in PendingIntents #5442

Open BenHenning opened 1 week ago

BenHenning commented 1 week ago

Describe the bug

When pushing the latest release to Play Console, it provided warnings about:

Apps targeting Android 12 or later must specify the mutability of PendingIntents with either FLAG_IMMUTABLE or FLAG_MUTABLE. Having unspecified mutability may cause your app to crash.

And it links to https://developer.android.com/about/versions/12/behavior-changes-12#pending-intent-mutability. We don't use PendingIntents directly, so this is related to dependencies. The ones detected by Play Console are (obfuscated for the latest release):

Unfortunately, none of these seem to be part of our codebase (at least from what I could see in our proguard.map file, so they're probably coming from GMS if I was to guess (I can't be positive).

Steps To Reproduce

N/A, though I think there might be a way to check for this using Android lint (needs more research) from looking briefly at https://stackoverflow.com/q/67045607/3689782.

Expected Behavior

We should avoid this warning by ensuring our app is Android 31 compliant.

Screenshots/Videos

No response

What device/emulator are you using?

N/A

Which Android version is your device/emulator running?

All

Which version of the Oppia Android app are you using?

0.13-beta-dcde7b359e

Additional Context

Note that Play Console warns about potential crashes, but I'm fairly certain the app never hits these scenarios. However, more testing will be needed on a newer version of Android just to be sure.

This probably ultimately requires isolating and then updating the corresponding dependencies. Updating dependencies is a difficult problem for us without more significant e2e testing, and it almost certainly will cause compatibility issues with Gradle.

adhiamboperes commented 4 days ago

Linking this comment from @seanlip: https://github.com/oppia/oppia-android/issues/4751#issuecomment-1685210663, the app is definitely crashing.

From looking around the web, this is happening on s+ devices because of our workmanager version. See note: https://developer.android.com/jetpack/androidx/releases/work#version_27_2.

adhiamboperes commented 3 days ago

Reported crashes logged at:

https://github.com/oppia/oppia-android/issues/5452