Page 1 of 1

FLAG_IMMUTABLE

Posted: Mon Nov 28, 2022 9:36 pm
by jayctheriot
Under "Pre-launch report details" the "Crashes and ANRs" Google Play Console throws the following error:
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.
I believe the flag must be declared somewhere in the compiler, but where?

My research has shown that API 30 and above requires declaration of either FLAG_IMMUTABLE or FLAG_MUTABLE to run on the latest Android 12 or 13 devices.

The app runs fine on Android 11 devices but won't even start on 12 or 13 devices.

Any pointers would be greatly appreciated so I can hunt this problem to its root.

Thanks in advance,
Jazzy J

Re: FLAG_IMMUTABLE

Posted: Sun Dec 04, 2022 2:10 pm
by airsoftsoftwair
Yep, that's a bug in APK Compiler 4.2. Luckily, APK Compiler 4.3 has just been released and fixes the issue. See here.

Re: FLAG_IMMUTABLE

Posted: Mon Dec 05, 2022 7:17 pm
by jayctheriot
Working!!

Thanks again,
Jazzy J

Re: FLAG_IMMUTABLE

Posted: Mon Dec 05, 2022 7:18 pm
by jayctheriot
Now, the work really begins.