Xamarin Method 'Plugin.Geolocator.Abstractions.IGeolocator.GetPositionAsync' not found

0

This is returning me an error:

  

"Method 'Plugin.Geolocator.Abstractions.IGeolocator.GetPositionAsync'   not found "

In the IOS version this is working fine, however on Android could someone give me a hint? It's my first app on Xamarin

using Xamarin.Forms;
using Plugin.Geolocator;
using System.Threading.Tasks;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using System;

namespace LocationSampleApp
{
    public partial class LocationSampleAppPage : ContentPage
    {
        public LocationSampleAppPage()
        {
            InitializeComponent();
            btnTeste.Clicked += BtnGetLocation_Clicked;
        }

        public async void BtnGetLocation_Clicked(object sender, EventArgs e)
        {
            await RetreiveLocation();
        }

        private async Task RetreiveLocation()
        {
            var locator = CrossGeolocator.Current;
            locator.DesiredAccuracy = 50;

            if (locator.IsGeolocationAvailable && locator.IsGeolocationEnabled)
            {
                var position = await locator.GetPositionAsync(TimeSpan.FromSeconds(100));
                if (position == null)
                    return;

                txtLang.Text = "Latitude " + position.Latitude.ToString();
                txtLong.Text = "Longitude " + position.Longitude.ToString();
            }
            else{
                await DisplayAlert("Error", "Home", "OK");
            }
        }
    }
}

    
asked by anonymous 21.07.2017 / 21:40

1 answer

0

Delete the BIN and OBJ folders of all projects and then RESTORE the packages! Xamarin has a lot of these little details! ;) I hope I have helped!

    
21.07.2017 / 23:14