Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] System.InvalidCastException #16

Open
jws2103 opened this issue May 21, 2019 · 2 comments
Open

[Android] System.InvalidCastException #16

jws2103 opened this issue May 21, 2019 · 2 comments

Comments

@jws2103
Copy link

jws2103 commented May 21, 2019

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.Lazy1[T].LazyInitValue () [0x00023] in :0
at System.Lazy`1[T].get_Value () [0x0003a] in :0
at Plugin.Geofence.CrossGeofence.get_Current () [0x0000d] in C:\Plugins\Geofence\src\Plugin.Geofence.Shared\CrossGeofence.cs:115
at Taskey.Forms.ViewModels.HomePageVM.StartTrackingLocation () [0x00002] in /Users/jaysim/Documents/CrowdCo/Taskey/taskey/Taskey.Forms/ViewModels/HomePageVM.cs:65

Anyone has experienced such issue? It would be great if anyone has workaround for it.

Kind regards,
Jay

@flaviosuardi
Copy link

Hi,
no workaround for this issue: before to call any methods of CrossGeofence.Current you have to grant location permissions.
Flavio

@jochembroekhoff
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants