3

As per Google's policy, I updated my targetSdkVersion and compileSdkVersion to 31. But I noticed that the Flutter local notification package now throws error for incoming messages as below: 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.

I went through all the Stack overflow answers related to this error and made following changes:

  1. Added below Java and Kotlin dependencies in build.gradle file:build.gradle file
  2. Added this receiver below activity tag: Receiver tag
  3. Added exported flag under activity tag: Exported flag
  4. Updated gradle version to latest in gradle-wrapper.properties: Latest gradle version I am not using any PendingIntent in my code, and simulating app on simulator with API 31 level. Could someone please help me in resolving this issue with message notifications?
Gaurangi
  • 31
  • 2

0 Answers0