Ionic Capacitor Upgraded Target SDK to 31 : Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent

Hello Guys,

I’m having this issue because of the minimum target SDK 31 update for the Play Store

I’ve had the App working well, I changed the TargetSDK in the gradle variables file and I’m getting this error :

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.

Here’s the List of My Plugins :
(npx cap ls)

   @capacitor-community/admob@3.2.0
   @capacitor/app@1.1.1
   @capacitor/haptics@1.1.4
   @capacitor/keyboard@1.2.2
   @capacitor/push-notifications@1.0.9
   @capacitor/splash-screen@1.2.2
   @capacitor/status-bar@1.0.8
   @codetrix-studio/capacitor-google-auth@3.1.4

[info] Listing plugins for web is not possible.

I’ve read That I need to upgrade some plugins but i don’t know which ones

Can you please help me

You need to upgrade to Capacitor 4. This is a required update for Capacitor to correctly support SDK 31 as the target SDK. You should follow the upgrade guide here, or you can install the VS Code extension which has an option to run the auto-migration tooling as well.

1 Like