flutterlocation icon indicating copy to clipboard operation
flutterlocation copied to clipboard

Android 12 issue changeNotificationOptions parameter onTapBringToFront

Open bbarbosa84 opened this issue 3 years ago • 16 comments

Just On Android 12 when I call location.changeNotificationOptions with the parameter onTapBringToFront = true flutter generates the error below

E/flutter ( 6703): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: PlatformException(CHANGE_NOTIFICATION_OPTIONS_ERROR, An unexpected error happened during notification options change:com.smartinteragerisk: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
E/flutter ( 6703): 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., null, null)

I tested in Android, API 31 simulator and real device

Someone can help me?

bbarbosa84 avatar Mar 16 '22 02:03 bbarbosa84

I am also facing the same issue. Any workaround?

tarunsareen-qss avatar Mar 22 '22 11:03 tarunsareen-qss

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Apr 28 '22 03:04 stale[bot]

Any updates?

ahmetcj4 avatar May 25 '22 14:05 ahmetcj4

I have the same issue, any updates? Tested on Android, API 31 real device. No issue on Android 11 real device.

lluisclava avatar Jul 11 '22 16:07 lluisclava

I have the same issue, any updates?

bazrafkan avatar Aug 11 '22 03:08 bazrafkan

Same issue, any updates?

taila-teq avatar Oct 24 '22 08:10 taila-teq

Nothing yet I guess...

 error = PlatformException(CHANGE_NOTIFICATION_OPTIONS_ERROR, An unexpected error happened during notification options change:com.livelikelocal.app: 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., null, null) 🚫 

I added implementation 'androidx.work:work-runtime-ktx:2.7.0' in gradle but nothing changed

arg0nath avatar Nov 22 '22 15:11 arg0nath

I have the same issue, app not working on API 31+. Is there any workaround for this?

vdjurdjevic avatar Dec 09 '22 16:12 vdjurdjevic

I guess we're fucked

Hot fixes

  1. Downgrading targetSdk to 30 works (if you can)
  2. You can also set onTapBringToFront: false when calling changeNotificationOptions

I think this is the culprit

lemohammed avatar Dec 19 '22 05:12 lemohammed

Same issue here

mdembny avatar Mar 21 '23 07:03 mdembny

Same issue here

bilalalmofleh avatar May 18 '23 09:05 bilalalmofleh

Same issue

giovanni256 avatar May 19 '23 21:05 giovanni256

No movement in over a year.. I don't think this one is going to get fixed...

Since the play store now has a rule that new apps must target API 33 downgrading just isn't an option.

TonyHoyle avatar Jul 30 '23 10:07 TonyHoyle

Possible fix: https://github.com/Lyokone/flutterlocation/pull/640 Duplicated: https://github.com/Lyokone/flutterlocation/issues/639

Would be great to see any movement on this as it is a bummer for the app users :(.

Cotspheer avatar Aug 03 '23 11:08 Cotspheer

The bug has been fixed in version 5.0.3 I tested it and it worked

bbarbosa84 avatar Aug 16 '23 00:08 bbarbosa84