GeofencePlugin
GeofencePlugin copied to clipboard
[Android] System.InvalidCastException
Hi,
I've installed the latest version (1.0.1) to Xamarin.Forms(3.5.0.129452) project and followed the same set up what's described in the documentation.
This issue only happens on Android where I'm trying to access CrossGeofence.Current.
Here's a full log what's actually thrown.
at Plugin.Geofence.GeofenceImplementation.RequestPermissions () [0x00000] in C:\Plugins\Geofence\src\Plugin.Geofence.Android\GeofenceImplementation.cs:706
at Plugin.Geofence.GeofenceImplementation..ctor () [0x00031] in C:\Plugins\Geofence\src\Plugin.Geofence.Android\GeofenceImplementation.cs:126
at Plugin.Geofence.CrossGeofence.CreateGeofence () [0x00000] in C:\Plugins\Geofence\src\Plugin.Geofence.Shared\CrossGeofence.cs:131
at Plugin.Geofence.CrossGeofence+<>c.<.cctor>b__55_0 () [0x00000] in C:\Plugins\Geofence\src\Plugin.Geofence.Shared\CrossGeofence.cs:13
at System.Lazy1[T].CreateValue () [0x00081] in <d4a23bbd2f544c30a48c44dd622ce09f>:0 at System.Lazy
1[T].LazyInitValue () [0x00023] in
Anyone has experienced such issue? It would be great if anyone has workaround for it.
Kind regards, Jay
Hi,
no workaround for this issue: before to call any methods of CrossGeofence.Current
you have to grant location permissions.
Flavio
Looking through some commits, it appears that this issue will have been fixed by #6. It would be useful if there were a pre-release that incorporated this fix.