You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Java.Lang.IllegalArgumentException: 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.'
#45
Open
BhargavSai-17 opened this issue
May 24, 2024
· 0 comments
I'm encountering an issue while trying to implement the Geofencing feature in my MAUI application targeting Android 34 (Android 14.0). When attempting to start monitoring a region, I receive the following exception:
Java.Lang.IllegalArgumentException: 'namespace': 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 noticed that the Plugin.Geofence library uses PendingIntent.UpdateCurrent. Following the latest Android policies, I modified the PendingIntentFlags to Mutable instead of UpdateCurrent and rebuilt the solution, generating the Plugin.Geofence.dll.
I built the DLL based on the MonoAndroid10.0 framework and installed the necessary packages:
Xamarin.Android.Support.V4 - 28.0.0.3
Xamarin.AndroidX.Legacy.Support.V4 - 1.0.0.6
Xamarin.AndroidX.Migration - 1.0.8
Xamarin.GooglePlayServices.Location - 120.0.02
With these changes, I could create a geofence without encountering the above-mentioned exception. However, the geofencing events (Entry, Exit, and Stayed) are not triggering correctly. Specifically, the Entry event triggers immediately upon starting monitoring, even when the device is not within the geofence.
Could you provide guidance or support to resolve this issue? Any assistance in making the plugin fully compatible with higher Android versions would be greatly appreciated.
Thank you.
The text was updated successfully, but these errors were encountered:
Hello @rdelrosario ,
I'm encountering an issue while trying to implement the Geofencing feature in my MAUI application targeting Android 34 (Android 14.0). When attempting to start monitoring a region, I receive the following exception:
Java.Lang.IllegalArgumentException: 'namespace': 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 noticed that the Plugin.Geofence library uses PendingIntent.UpdateCurrent. Following the latest Android policies, I modified the PendingIntentFlags to Mutable instead of UpdateCurrent and rebuilt the solution, generating the Plugin.Geofence.dll.
I built the DLL based on the MonoAndroid10.0 framework and installed the necessary packages:
With these changes, I could create a geofence without encountering the above-mentioned exception. However, the geofencing events (Entry, Exit, and Stayed) are not triggering correctly. Specifically, the Entry event triggers immediately upon starting monitoring, even when the device is not within the geofence.
Could you provide guidance or support to resolve this issue? Any assistance in making the plugin fully compatible with higher Android versions would be greatly appreciated.
Thank you.
The text was updated successfully, but these errors were encountered: