title: security-crypto: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent
body: <p>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.</p>
  <p>stacktrace:</p>
  <p>com.google.crypto.tink.shaded.protobuf.FieldType$Collection. (FieldType.java:337)
  androidx.security.crypto.EncryptedSharedPreferences$PrefKeyEncryptionScheme. (EncryptedSharedPreferences.java:148)
  PreferenceHelper$Companion.init (PreferenceHelper.kt:41)</p>
  <p>this is how i initialize SharedPreferences:</p>
  <pre><code>private lateinit var preferences: SharedPreferences
  
  fun init(context: Context) {
       val mainKey = MasterKeys.getOrCreate(MasterKeys.AES256_GCM_SPEC);
       preferences = EncryptedSharedPreferences.create(
                  SHARED_PREF_KEY,
                  mainKey,
                  context,
                  EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV,   &lt;- this is the 41 line number, where its crashing
                  EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM
           )
  
   }
  </code></pre>
  <p>Any help please ?</p>