Flutter/Android Push notification error

I am working on the push notification integration of my Flutter application and have been facing the following issue with the Android build of the app regarding a “PendingIntent” requiring a “FLAG_IMMUTABLE” argument.

I found the following support thread regarding a similar issue
https://support.backendless.com/t/push-notifications-causing-a-crash-when-targeting-android-api-31/14513/6 but the solution applied in the Backendless Android SDK 6.3.6 seems to have not worked for the template-based pushes from the Backendless console.

These looks to be the relevant lines in the Backendless Android SDK:


Since template-based pushing currently fails, is there a method through the Backendless console of sending push notifications that are not template based?

Backendless Version (3.x / 5.x, Online / Managed / Pro )


Client SDK (REST / Android / Objective-C / Swift / JS )

Backendless Flutter SDK: 7.2.7
Backendless Android SDK: 6.3.6

Application ID


Expected Behavior

Please describe the expected behavior of the issue, starting from the first action.

  1. Send a push notification template from the Backendless Console
  2. Push notification is handled while mobile app is backgrounded

Actual Behavior

  1. Send a push notification template from the Backendless Console
  2. Push notification handler crashes with the following:

E/BackendlessFCMService( 3090): Error processing push notification
E/BackendlessFCMService( 3090): java.lang.IllegalArgumentException: us.boundlessdesign.customer_support_blue: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
E/BackendlessFCMService( 3090): 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.
E/BackendlessFCMService( 3090): at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
E/BackendlessFCMService( 3090): at android.app.PendingIntent.getActivityAsUser(PendingIntent.java:458)
E/BackendlessFCMService( 3090): at android.app.PendingIntent.getActivity(PendingIntent.java:444)
E/BackendlessFCMService( 3090): at android.app.PendingIntent.getActivity(PendingIntent.java:408)
E/BackendlessFCMService( 3090): at com.backendless.push.PushTemplateHelper.convertFromTemplate(PushTemplateHelper.java:267)
E/BackendlessFCMService( 3090): at com.backendless.push.BackendlessFCMService.handleMessageWithTemplate(BackendlessFCMService.java:134)
E/BackendlessFCMService( 3090): at com.backendless.push.BackendlessFCMService.handleMessage(BackendlessFCMService.java:102)
E/BackendlessFCMService( 3090): at com.backendless.push.BackendlessFCMService.onMessageReceived(BackendlessFCMService.java:68)
E/BackendlessFCMService( 3090): at com.google.firebase.messaging.FirebaseMessagingService.dispatchMessage(FirebaseMessagingService.java:235)
E/BackendlessFCMService( 3090): at com.google.firebase.messaging.FirebaseMessagingService.passMessageIntentToSdk(FirebaseMessagingService.java:185)
E/BackendlessFCMService( 3090): at com.google.firebase.messaging.FirebaseMessagingService.handleMessageIntent(FirebaseMessagingService.java:172)
E/BackendlessFCMService( 3090): at com.google.firebase.messaging.FirebaseMessagingService.handleIntent(FirebaseMessagingService.java:161)
E/BackendlessFCMService( 3090): at com.google.firebase.messaging.EnhancedIntentService.lambda$processIntent$0$EnhancedIntentService(EnhancedIntentService.java:78)
E/BackendlessFCMService( 3090): at com.google.firebase.messaging.-$$Lambda$EnhancedIntentService$NSk2h75eWhBOI4TsAFgvvtv1g9o.run(Unknown Source:6)

Hello @Mark_Moline

We were able to reproduce the issue, I have created an internal ticket BKNDLSS-30863 to fix it. The problem appears for the android SDK > 29 version.

Is there any workaround that I could implement for template-based push notifications in the meantime?

And if not, what do you think the timeline is on a published fix?

Thank you very much for looking into it!

hello @Mark_Moline

the workaround is to use android SDK <= 29. The fix is pretty complicated it will be available in 1-2 months

Gotcha. I believe the current Google store requirements are for new apps and updates to target at least SDK 31.

Looking forward to the update in 1-2 months.

Sorry for long delay. Fixed in 7.3.0 version of backendless_sdk for Flutter.