Status Update
Comments
pa...@outlook.com <pa...@outlook.com> #2
FYI even though I do not use it, I also included the following to see if it would solve this problem
implementation 'androidx.work:work-runtime:2.7.0'
but it does not solve it, the problem remains unchanged
em...@google.com <em...@google.com> #3
The flag fields are constant and inlinable, so you should be able to use @SuppressLint
This is the Jetpack (androidx
) libraries issue tracker component, and this API isn't from a Jetpack library so I'm going to close it for now.
pa...@outlook.com <pa...@outlook.com> #4
It crashes when applying your suggestions. Thanks for closing this extremely lunatic issue without a single clue as to where the heck it should be posted on. Management decided to pull the plug on upgrading the app to Android 12, so we're gonna revert the SDK compatibility to 30 and below as a direct result of this bug until the day you guys decide to fix this monumental disaster. Never change, guys 👍
Description
Currently updated the min sdk version to 31 and now the entire application is crashing because of a
PendingIntent
mutability flag enforced requirement.Previous versions it assumed the default, which is
FLAG_MUTABLE
. Now it requires aFLAG_IMMUTABLE
orFLAG_MUTABLE
to be set.When I set
FLAG_IMMUTABLE
on aPendingIntent
that contains aRemoteInput
the app crashes, because it requires a mutable flag instead.When I then put a
FLAG_MUTABLE
it shows the following:Field requires API level S (current min is 24): android.app.PendingIntent#FLAG_MUTABLE
And I can't make an
if (SDK >= S){}else{}
condition based on the SDK versions because IT STILL WON'T LET ME COMPILE UNLESS I INCLUDE A MUTABILITY FLAG IN THE ELSE BLOCK, BUT I CAN'T PUT THE MUTABLE FLAG BECAUSE OF THE SDK VERSION RESTRICTION, AND I CAN'T USE THE IMMUTABLE FLAG IN ITS PLACE BECAUSE IT CRASHES SINCE IT REQUIRES A MUTABLE FLAG FOR REMOTE INPUT PENDING INTENTS!!!! WHAT THE HELL IS THIS???So now I am stuck with this stupid nonsense and no clear solution for this found anywhere. The only 2 "options" are to drop the 31 sdk and not be able to make use of APIS THAT ARE ONLY AVAILABLE IN VERSION 31 OR NOT USE PENDING INTENTS AT ALL, WHICH IS COMPLETE INSANITY.
I already updated the core library to 1.7.0 and the problem still remains unsolved.
What the heck is up with this really, how come such nonsense has been allowed through this version. I am baffled and beyond frustrated with this.