Geofence Plugin for Xamarin Released

RendyDelRosarioRendyDelRosario DOUniversity ✭✭✭

Hi guys

Just released a plugin that supports geofence monitoring for iOS and Android Platform. Windows support coming soon. Try it and let me know if helps any one. Also have a list of TODOs if anyone would like to collaborate in this project that would be awesome!

Geofence NuGet PCL

Geofence Plugin Github repository

Thanks.

«1

Posts

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    @RendyDelRosario well done, good work.

  • RendyDelRosarioRendyDelRosario DOUniversity ✭✭✭

    Thanks @AlessandroCaliaro. Tested it already?

    I will upload a sample app maybe tomorrow. To be easier to see how it works.

  • Mohanlal.2391Mohanlal.2391 USUniversity ✭✭

    Hi,

    I have to fire local notification from based on geofencing result . It worked when app in online and bagrounded but it is not working when the app is offline. Please advice is it possible using this Nugget ? Please share some samples incase it is possible.

    Regards
    Mohanlal

  • aunanueaunanue ARMember ✭✭

    @RendyDelRosario is there any method on your plugin to get the current location?
    I need to get the current location of the device before starting with the monitoring, can this current location be retrieved with your plugin?

  • RendyDelRosarioRendyDelRosario DOUniversity ✭✭✭

    There's a property you can use:

    GeofenceLocation LastKnownLocation { get; }

    CrossGeofence.Current.LastKnownLocation;

  • @RendyDelRosario Hello again. I'm having issues with the plugin I start monitoring a region I get the OnMonitoringStarted event and OnError is not fired so I assumed is monitoring. However I never get OnRegionStateChanged event
    Any ideas?

  • Ok the OnStay is the only event that is not firing now.

  • RendyDelRosarioRendyDelRosario DOUniversity ✭✭✭

    @AlejandroForonda did you set NotifyOnStay to true? When started monitoring the region?

  • AlejandroForondaAlejandroForonda BOMember
    edited August 2015

    @RendyDelRosario Yes. Is set to true

  • RendyDelRosarioRendyDelRosario DOUniversity ✭✭✭

    Are you testing on Android or iOS?

  • DavidCatteuwDavidCatteuw USMember ✭✭
    edited December 2015

    Hello @RendyDelRosario ! Thanks for this nice plugin!
    I'm having an issue on iOS devices though.

    In my AppDelegate I call:
    CrossGeofence.Initialize<GeofenceListener>();

    Then, in the OnStart override of my Forms application, I call:

    var region = new GeofenceCircularRegion("Region name", lat, long, range)
    {
          NotifyOnEntry = true,
          NotifyOnExit = true
    };
    
    var crossGeofenceInstance = CrossGeofence.Current;
    crossGeofenceInstance.StartMonitoring(region);
    

    On Android and an iOS 9.1 simulator, this works flawlessly, and I get notified when entering or leaving my region
    On a real iOS 9.1 device though, I get an exception while fetching CrossGeofence.Current:

    Unhandled Exception:
    
    System.InvalidCastException: Specified cast is not valid.
    
    2015-12-09 14:14:47.720 BeaconsPrototypeiOS[2189:1301181] 
    Unhandled Exception:
    System.InvalidCastException: Specified cast is not valid.
      at Geofence.Plugin.GeofenceImplementation..ctor () [0x001a7] in <filename unknown>:0 
      at Geofence.Plugin.CrossGeofence.CreateGeofence () [0x00000] in <filename unknown>:0 
      at Geofence.Plugin.CrossGeofence.<.cctor>b__0 () [0x00000] in <filename unknown>:0 
      at System.Lazy`1[T].CreateValue () <0x1000b7c00 + 0x0017b> in <filename unknown>:0 
    2015-12-09 14:14:47.721 BeaconsPrototypeiOS[2189:1301181] Unhandled managed exception:
    Specified cast is not valid. (System.InvalidCastException)
      at Geofence.Plugin.GeofenceImplementation..ctor () [0x001a7] in <filename unknown>:0 
      at Geofence.Plugin.CrossGeofence.CreateGeofence () [0x00000] in <filename unknown>:0 
      at Geofence.Plugin.CrossGeofence.<.cctor>b__0 () [0x00000] in <filename unknown>:0 
      at System.Lazy`1[T].CreateValue () <0x1000b7c00 + 0x0017b> in <filename unknown>:0 
    2015-12-09 14:14:47.722 BeaconsPrototypeiOS[2189:1301181] critical: Stacktrace:
    
    2015-12-09 14:14:47.722 BeaconsPrototypeiOS[2189:1301181] critical: 
    Native stacktrace:
    2015-12-09 14:14:47.966 BeaconsPrototypeiOS[2189:1301181] critical:     0   BeaconsPrototypeiOS                 0x00000001012865e8 mono_handle_native_sigsegv + 260
    2015-12-09 14:14:47.966 BeaconsPrototypeiOS[2189:1301181] critical:     1   libsystem_platform.dylib            0x000000019897d94c _sigtramp + 68
    2015-12-09 14:14:47.966 BeaconsPrototypeiOS[2189:1301181] critical:     2   libsystem_pthread.dylib             0x0000000198984ef8 pthread_kill + 112
    2015-12-09 14:14:47.966 BeaconsPrototypeiOS[2189:1301181] critical:     3   libsystem_c.dylib                   0x000000019882eb78 abort + 140
    2015-12-09 14:14:47.966 BeaconsPrototypeiOS[2189:1301181] critical:     4   BeaconsPrototypeiOS                 0x0000000101353104 _ZL15print_exceptionP10MonoObjectbP15NSMutableString + 0
    2015-12-09 14:14:47.966 BeaconsPrototypeiOS[2189:1301181] critical:     5   BeaconsPrototypeiOS                 0x0000000101286cb4 mono_invoke_unhandled_exception_hook + 96
    2015-12-09 14:14:47.966 BeaconsPrototypeiOS[2189:1301181] critical:     6   BeaconsPrototypeiOS                 0x00000001012863fc mono_handle_exception_internal + 4228
    2015-12-09 14:14:47.966 BeaconsPrototypeiOS[2189:1301181] critical:     7   
    BeaconsPrototypeiOS                 0x000000010128536c mono_handle_exception + 40
    2015-12-09 14:14:47.966 BeaconsPrototypeiOS[2189:1301181] critical:     8   BeaconsPrototypeiOS                 0x000000010127f30c mono_arm_throw_exception + 200
    2015-12-09 14:14:47.966 BeaconsPrototypeiOS[2189:1301181] critical:     9   BeaconsPrototypeiOS                 0x0000000100329188 rethrow_exception + 168
    2015-12-09 14:14:47.967 BeaconsPrototypeiOS[2189:1301181] critical:     10  BeaconsPrototypeiOS                 0x00000001000b7e14 System_Lazy_1_T_REF_CreateValue + 532
    2015-12-09 14:14:47.967 BeaconsPrototypeiOS[2189:1301181] critical:     11  BeaconsPrototypeiOS                 0x00000001000b7918 System_Lazy_1_T_REF_LazyInitValue + 104
    2015-12-09 14:14:47.967 BeaconsPrototypeiOS[2189:1301181] critical:     12  BeaconsPrototypeiOS                 0x00000001000b7890 System_Lazy_1_T_REF_get_Value + 208
    2015-12-09 14:14:47.967 BeaconsPrototypeiOS[2189:1301181] critical:     13  BeaconsPrototypeiOS                 0x0000000100f61cb8 Geofe
    nce_Plugin_CrossGeofence_get_Current + 216
    2015-12-09 14:14:47.967 BeaconsPrototypeiOS[2189:1301181] critical:     14  BeaconsPrototypeiOS                 0x0000000100ec3c44 BeaconsPrototype_App_StartGeofenceTest + 436
    2015-12-09 14:14:47.967 BeaconsPrototypeiOS[2189:1301181] critical:     15  BeaconsPrototypeiOS                 0x0000000100ec3a50 BeaconsPrototype_App_OnStart + 144
    2015-12-09 14:14:47.967 BeaconsPrototypeiOS[2189:1301181] critical:     16  BeaconsPrototypeiOS                 0x0000000100a35c18 Xamarin_Forms_Application_SendStart + 104
    2015-12-09 14:14:47.967 BeaconsPrototypeiOS[2189:1301181] critical:     17  BeaconsPrototypeiOS                 0x000000010091dea0 Xamarin_Forms_Platform_iOS_FormsApplicationDelegate_FinishedLaunching_UIKit_UIApplication_Foundation_NSDictionary + 448
    2015-12-09 14:14:47.967 BeaconsPrototypeiOS[2189:1301181] critical:     18  BeaconsPrototypeiOS                 0x0000000100094aec BeaconsPrototype_iOS_AppDelegate_FinishedLaunching_UIKit_UIApplication_Foundation_NSDictionary + 60
    4
    2015-12-09 14:14:47.967 BeaconsPrototypeiOS[2189:1301181] critical:     19  BeaconsPrototypeiOS                 0x00000001002f6bc4 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 244
    2015-12-09 14:14:47.968 BeaconsPrototypeiOS[2189:1301181] critical:     20  BeaconsPrototypeiOS                 0x0000000101290810 mono_jit_runtime_invoke + 1280
    2015-12-09 14:14:47.968 BeaconsPrototypeiOS[2189:1301181] critical:     21  BeaconsPrototypeiOS                 0x00000001012e5474 mono_runtime_invoke + 124
    2015-12-09 14:14:47.968 BeaconsPrototypeiOS[2189:1301181] critical:     22  BeaconsPrototypeiOS                 0x0000000101243438 _ZL30native_to_managed_trampoline_4P11objc_objectP13objc_selectorPP11_MonoMethodS0_S0_PKcS7_S7_S7_ + 640
    2015-12-09 14:14:47.969 BeaconsPrototypeiOS[2189:1301181] critical:     23  BeaconsPrototypeiOS                 0x0000000101243944 -[AppDelegate application:didFinishLaunchingWithOptions:] + 96
    2015-12-09 14:14:47.969 BeaconsPrototypeiOS[2189:1301181] critical:     2
    4  UIKit                               0x0000000188711324 <redacted> + 400
    2015-12-09 14:14:47.969 BeaconsPrototypeiOS[2189:1301181] critical:     25  UIKit                               0x000000018893facc <redacted> + 2904
    2015-12-09 14:14:47.969 BeaconsPrototypeiOS[2189:1301181] critical:     26  UIKit                               0x0000000188943e0c <redacted> + 1656
    2015-12-09 14:14:47.969 BeaconsPrototypeiOS[2189:1301181] critical:     27  UIKit                               0x0000000188940f50 <redacted> + 168
    2015-12-09 14:14:47.969 BeaconsPrototypeiOS[2189:1301181] critical:     28  FrontBoardServices                  0x000000018cd7f7c4 <redacted> + 184
    2015-12-09 14:14:47.970 BeaconsPrototypeiOS[2189:1301181] critical:     29  FrontBoardServices                  0x000000018cd7fb44 <redacted> + 56
    2015-12-09 14:14:47.970 BeaconsPrototypeiOS[2189:1301181] critical:     30  CoreFoundation                      0x00000001830c0544 <redacted> + 24
    2015-12-09 14:14:47.970 BeaconsPrototypeiOS[2189:1301181] critical:     31  CoreFo
    undation                      0x00000001830bffd8 <redacted> + 540
    2015-12-09 14:14:47.970 BeaconsPrototypeiOS[2189:1301181] critical:     32  CoreFoundation                      0x00000001830bdcd8 <redacted> + 724
    2015-12-09 14:14:47.970 BeaconsPrototypeiOS[2189:1301181] critical:     33  CoreFoundation                      0x0000000182fecca0 CFRunLoopRunSpecific + 384
    2015-12-09 14:14:47.970 BeaconsPrototypeiOS[2189:1301181] critical:     34  UIKit                               0x000000018870a1c8 <redacted> + 460
    2015-12-09 14:14:47.970 BeaconsPrototypeiOS[2189:1301181] critical:     35  UIKit                               0x0000000188704ffc UIApplicationMain + 204
    2015-12-09 14:14:47.970 BeaconsPrototypeiOS[2189:1301181] critical:     36  BeaconsPrototypeiOS                 0x00000001008e3e54 wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 324
    2015-12-09 14:14:47.970 BeaconsPrototypeiOS[2189:1301181] critical:     37  BeaconsPrototypeiOS                 0x000000010085d64c UIKit_UI
    

    Do you have any idea how I could fix this?

    Best regards,

    David

  • RendyDelRosarioRendyDelRosario DOUniversity ✭✭✭

    Hi

    @DavidCatteuw Are you still having the issue?

    Do you have a sample repo that reproduce this situation to test?

  • DavidCatteuwDavidCatteuw USMember ✭✭

    @RendyDelRosario said:
    Hi

    @DavidCatteuw Are you still having the issue?

    Do you have a sample repo that reproduce this situation to test?

    Hello Rendy,

    The iOS version of my prototype has been put on hold for the moment, so I can't really dedicate any time to it right now.
    I'll get back to you when this gets started up again.

    Thanks again for the nice library!

    Best regards,

    David

  • JoeyZacherlJoeyZacherl USMember ✭✭

    I've tested this out with iOS (will be testing android in the near future), it works very well for me. Nice job OP!

  • MilenPavlov.0879MilenPavlov.0879 USUniversity

    Hi, Just added the plug in to my app - Xamain.Android.
    I get this exception when trying to add geofence:

               var gf = new GeofenceCircularRegion(geofenceData.Title, geofenceData.Latitude, geofenceData.Longitude, geofenceData.Radius);
    
                CrossGeofence.Current.StartMonitoring(gf);
    

    System.TypeLoadException: Could not load type 'Android.Gms.Common.GoogleApiAvailability' from assembly 'Xamarin.GooglePlayServices.Basement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. 01-29 09:32:18.249 I/mono-stdout(27865): System.TypeLoadException: Could not load type 'Android.Gms.Common.GoogleApiAvailability' from assembly 'Xamarin.GooglePlayServices.Basement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. 01-29 09:32:18.250 I/mono-stdout(27865): at Geofence.Plugin.GeofenceImplementation.IsLocationEnabled (System.Action1 returnAction) [0x0000d] in C:\Users\rendy\Maven\xamarin-plugins\Geofence\Geofence\Geofence.Plugin.Android\GeofenceImplementation.cs:133
    at Geofence.Plugin.GeofenceImplementation.IsLocationEnabled (System.Action1 returnAction) [0x0000d] in C:\Users\rendy\Maven\xamarin-plugins\Geofence\Geofence\Geofence.Plugin.Android\GeofenceImplementation.cs:133 at Geofence.Plugin.GeofenceImplementation..ctor () [0x00021] in C:\Users\rendy\Maven\xamarin-plugins\Geofence\Geofence\Geofence.Plugin.Android\GeofenceImplementation.cs:112 01-29 09:32:18.250 I/mono-stdout(27865): at Geofence.Plugin.GeofenceImplementation..ctor () [0x00021] in C:\Users\rendy\Maven\xamarin-plugins\Geofence\Geofence\Geofence.Plugin.Android\GeofenceImplementation.cs:112 01-29 09:32:18.250 I/mono-stdout(27865): at Geofence.Plugin.CrossGeofence.CreateGeofence () [0x00000] in C:\Users\rendy\Maven\xamarin-plugins\Geofence\Geofence\Geofence.Plugin\CrossGeofence.cs:128 01-29 09:32:18.251 I/mono-stdout(27865): at Geofence.Plugin.CrossGeofence+<>c.<.cctor>b__55_0 () [0x00000] in C:\Users\rendy\Maven\xamarin-plugins\Geofence\Geofence\Geofence.Plugin\CrossGeofence.cs:14 at Geofence.Plugin.CrossGeofence.CreateGeofence () [0x00000] in C:\Users\rendy\Maven\xamarin-plugins\Geofence\Geofence\Geofence.Plugin\CrossGeofence.cs:128 at Geofence.Plugin.CrossGeofence+<>c.<.cctor>b__55_0 () [0x00000] in C:\Users\rendy\Maven\xamarin-plugins\Geofence\Geofence\Geofence.Plugin\CrossGeofence.cs:14

    My package config:

    <package id="Xam.Plugin.Geofence" version="1.0.9" targetFramework="monoandroid44" developmentDependency="true" /> <package id="Xamarin.Android.Support.v4" version="23.1.1.0" targetFramework="monoandroid44" /> <package id="Xamarin.Android.Support.v7.AppCompat" version="22.2.0.0" targetFramework="monoandroid44" /> <package id="Xamarin.Android.Support.v7.CardView" version="22.1.1.1" targetFramework="monoandroid44" /> <package id="Xamarin.GooglePlayServices.Auth" version="29.0.0-beta1" targetFramework="monoandroid44" /> <package id="Xamarin.GooglePlayServices.Base" version="29.0.0-beta1" targetFramework="monoandroid44" /> <package id="Xamarin.GooglePlayServices.Basement" version="29.0.0-beta1" targetFramework="monoandroid44" /> <package id="Xamarin.GooglePlayServices.Gcm" version="29.0.0-beta1" targetFramework="monoandroid44" /> <package id="Xamarin.GooglePlayServices.Location" version="29.0.0-beta1" targetFramework="monoandroid44" /> <package id="Xamarin.GooglePlayServices.Maps" version="29.0.0-beta1" targetFramework="monoandroid44" /> <package id="Xamarin.GooglePlayServices.Measurement" version="29.0.0-beta1" targetFramework="monoandroid44" /> <package id="Xamarin.GooglePlayServices.Plus" version="29.0.0-beta1" targetFramework="monoandroid44" />

  • MilenPavlov.0879MilenPavlov.0879 USUniversity

    Packages issue as it turns out I'm using 29.0.0-beta1 and plugin uses 27.0.0.0 currently. Downgraded to 27 and all worked fine.

  • RendyDelRosarioRendyDelRosario DOUniversity ✭✭✭
    edited January 2016

    Right @MilenPavlov.0879 We are not supporting 29 beta yet, just stable versions

  • MilenPavlov.0879MilenPavlov.0879 USUniversity

    @RendyDelRosario btw works just fine with 29 beta too :)

  • Hi @RendyDelRosario, thanks for doing this!

    Does this Nuget also support updates even when the app is terminated? As in a background service that will get notified when there is a Geofence change?

  • RendyDelRosarioRendyDelRosario DOUniversity ✭✭✭
  • AcquariusAcquarius ITMember

    Hi,
    i cannot make geofence work when app is closed. i have created service and started but i don't receive notification for geofence :(

  • xinmengxinmeng GBMember ✭✭

    Hi @RendyDelRosario, thanks for your plugin.

    I encounter one problem when using the latest version. That is the Exit event will be invoked twice. It means that Enter the region occur one time, however the Exited the region occur 2 times. I have try the sample which use the 1.0.4 without this problem. However I update the plugin to 1.1.1, the problem occurred again in the Sample. I think it is a bug maybe.

    Test Case: Using iOS Emulator

    Set the location as the custom location:
    
    La: 51.625742
    Lo: -0.7424
    
    Open the Sample App
    
    Add the fence at current location and radius is 10 
    
    Then choose the City Run in the Location emulator.
    
    There will be two notifications for Exited geofence region.
    
  • xinmengxinmeng GBMember ✭✭

    @RendyDelRosario

    Could I ask one question for this Plugin?

    I have tried the sample code, it worked and I found even I close the app (swipe it out after double click home button),it still can monitor the region change.

    However, I want to implement this function too. I have try it in my code, I found except I put the StartMonitoring in the OnAppStart function, the monitor can not valid after I close the app. I compare the code with the sample, and I cannot find any different except the sample code use Xamarin.FormMaps. Is this the reason why the sample code can run even the app close?

    If not Could you give me some suggestion how to enable the region monitor running background after the app close?

  • xinmengxinmeng GBMember ✭✭

    @xinmeng said:
    @RendyDelRosario

    Could I ask one question for this Plugin?

    I have tried the sample code, it worked and I found even I close the app (swipe it out after double click home button),it still can monitor the region change.

    However, I want to implement this function too. I have try it in my code, I found except I put the StartMonitoring in the OnAppStart function, the monitor can not valid after I close the app. I compare the code with the sample, and I cannot find any different except the sample code use Xamarin.FormMaps. Is this the reason why the sample code can run even the app close?

    If not Could you give me some suggestion how to enable the region monitor running background after the app close?

    @xinmeng said:
    @RendyDelRosario

    Could I ask one question for this Plugin?

    I have tried the sample code, it worked and I found even I close the app (swipe it out after double click home button),it still can monitor the region change.

    However, I want to implement this function too. I have try it in my code, I found except I put the StartMonitoring in the OnAppStart function, the monitor can not valid after I close the app. I compare the code with the sample, and I cannot find any different except the sample code use Xamarin.FormMaps. Is this the reason why the sample code can run even the app close?

    If not Could you give me some suggestion how to enable the region monitor running background after the app close?

    Quick update this problem:

    I just add a single debug line in the AppDelegate.cs, the background task monitor worked! Strange

    [Register ("AppDelegate")]
        public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
        {
            public override bool FinishedLaunching (UIApplication app, NSDictionary options)
            {
                global::Xamarin.Forms.Forms.Init ();
    
                CrossGeofence.Initialize<CrossGeofenceListener> ();
    //          Console.WriteLine ("===============================");
                Console.WriteLine ("IS MONITOR? " + CrossGeofence.Current.IsMonitoring.ToString ());
    //          Console.WriteLine ("Region Sum? " + CrossGeofence.Current.Regions.Count.ToString());
                CrossGeofence.GeofenceListener.OnAppStarted();
                LoadApplication (new App ());
    //          CrossGeofence.GeofenceListener.OnAppStarted();
                return base.FinishedLaunching (app, options);
            }
        }
    
  • xinmengxinmeng GBMember ✭✭

    Update the problem and solution when I use this plugin

    1. version problem

    the sample code is based on 1.0.4, as far as I know that I encountered twice exited notification issue by version 1.1.1. So I choose the 1.0.4.

    1. the Google play service.

    The old version is based on deprecated Google play service, ( I think 1.0.6 update it to new package which include 4 packages). so care about the package reference.

    <package id="Xamarin.GooglePlayServices" version="22.0.0.2" targetFramework="MonoAndroid50" />
    
  • BrianWilliamsBrianWilliams USUniversity ✭✭

    After last update Xamarin Forms 2.2.0.31 that finally fixed the Xamarin.Android.Support update issue, I'm now getting an error from this plugin I have no idea how to fix.

    Error: Error executing task LinkAssemblies: error XA2006: Reference to metadata item 'Android.Gms.Common.GoogleApiAvailability Android.Gms.Common.GoogleApiAvailability::get_Instance()' (defined in 'Geofence.Plugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null') from 'Geofence.Plugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' could not be resolved.

    Any help is appreciated.

  • BrianWilliamsBrianWilliams USUniversity ✭✭

    Figured it out, I removed all the GooglePlayServices and Xam.Plugin.Geofence then re-installed Geofence and let it get the dependancies. A few of the GooglePlayServices were .1 version too high.

  • Dennis.StringifyDennis.Stringify USMember ✭✭
    edited May 2016

    I'm getting the same error for RELEASE and PRODUCTION builds:

    Error: Error executing task LinkAssemblies: error XA2006: Reference to metadata item 'Android.Gms.Common.GoogleApiAvailability Android.Gms.Common.GoogleApiAvailability::get_Instance()' (defined in 'Geofence.Plugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null') from 'Geofence.Plugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' could not be resolved.

    Tried removing the Google play services packages and geofence, and re-adding geofence nuget package. But still seeing the error.

    Any ideas?

    thanks,
    Dennis

  • Abhijeet_SuryaAbhijeet_Surya USMember ✭✭✭

    @RendyDelRosario I am not getting any error.

    Able to test successfully in IOS, but in android not getting notified on any event event though tried with highest accuracy.

    I have conducted test using AVD & actual device also.

    Can you suggest on this, am I missing anything?

  • jzeferinojzeferino USUniversity ✭✭

    I having the same problem as @Dennis.Stringify

    /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Error executing task LinkAssemblies: error XA2006: Reference to metadata item 'Android.Gms.Common.GoogleApiAvailability Android.Gms.Common.GoogleApiAvailability::get_Instance()' (defined in 'Geofence.Plugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null') from 'Geofence.Plugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' could not be resolved.

    I was only able to deploy a release version only with "Don't Link Assemblies" in the Linker settings. But the package gets too big.

    Any suggestion @RendyDelRosario ?

  • RafaelPenaRafaelPena MXMember

    Hi , How can I Add routes and traffic to this sample?
    I tested the sample and
    it surprises me that it does not crash with the data/4G turned off. that's very good and stable.

  • CyrilCathalaCyrilCathala FRMember ✭✭

    Thanks for your awesome plugin, great job and it definitely is a time saver!

    Unfortunately, the current Xamarin.Forms.Maps references Play Services 29.0.0.1, which mismatches with the version referenced by the Geofence plugin (which is 27.0.0.0...).
    That creates problems as reported by @jzeferino or, in my case, something like:

    System.TypeLoadException: Could not load type 'Android.Gms.Common.GoogleApiAvailability' from assembly 'Xamarin.GooglePlayServices.Basement, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

    You might want to upgrade the plugin to 29.0.0.1 to fix this... :)

  • jzeferinojzeferino USUniversity ✭✭

    @CyrilCathala how did you managed to bypass that error? downgrading to 27.0.0.0? I donwgrade it but still the same error.

  • CyrilCathalaCyrilCathala FRMember ✭✭

    I've downloaded the source code, changed the reference to the Play Services (to target 29.0.0.1), got the dll and referenced then directly. Just make sure you clean you bin + obj folders before you build your project, otherwise it works perfectly!

  • fussbudgetfussbudget USMember
    edited June 2016

    Why would this be necessary, or even address the issue? The plugin requires 27.0.0.0 or greater .

  • jzeferinojzeferino USUniversity ✭✭

    It requires 27.0.0.0 but won't work if you update to 29.0.0.0.
    @CyrilCathala i don't want to have to reference the .dll. Its kinda bad because if they update the library i will need to refactor the dependency.
    I will try to make a PR for the repository.

  • CyrilCathalaCyrilCathala FRMember ✭✭

    Yes I know, I don't like it either but I couldn't wait, I have to ship my app pretty soon :/ I hope it'll be temporary (thanks to your PR maybe :smile: ).

«1
Sign In or Register to comment.