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

Is this returning me a bug 'Method' Plugin.Geolocator.Abstractions.IGeolocator.GetPositionAsync 'not found "

In the ios version this is working well on the android someone could give me a hint first app in 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");
            }


        }
    }
}

Best Answer

Answers

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭
    edited July 2017

    first app in xamarin

    I'm going to guess its your first app outside of school where they had you using Windows Forms circa 1999.
    In XAML based apps (WPF or Xamarin) we don't do this sort of stuff.

    **txtLang.Text =** "Latitude " + position.Latitude.ToString();
    **btnTeste.Clicked** += BtnGetLocation_Clicked;
    

    I would urge you to stop trying to build a new app from scratch. All you're doing to do is drive these bad habits and 20 year-out-of-date concepts further into your head: Making it harder to unlearn them.

    Work on some lessons for modern development techniques where you are just following the lesson plan and not trying to architect a solution.

  • NagiiNagii BRMember ✭✭
    edited July 2017

    @ClintStLaurent said:

    first app in xamarin

    I'm going to guess its your first app outside of school where they had you using Windows Forms circa 1999.
    In XAML based apps (WPF or Xamarin) we don't do this sort of stuff.

    **txtLang.Text =** "Latitude " + position.Latitude.ToString();
    **btnTeste.Clicked** += BtnGetLocation_Clicked;
    

    I would urge you to stop trying to build a new app from scratch. All you're doing to do is drive these bad habits and 20 year-out-of-date concepts further into your head: Making it harder to unlearn them.

    Work on some lessons for modern development techniques where you are just following the lesson plan and not trying to architect a solution.

    You could be less thick ..

    I know it's not ideal in a way that I'm doing I'm just testing the requirements you need no application and location and one of them as you can see in the image below each one of the projects and one thing you need in my project so if Call requirements lifting when it's actually doing IT I'm going to use MVVM ..

    Not for help, do not disturb.

    Grateful

  • NagiiNagii BRMember ✭✭
    edited July 2017

    .

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    I wish you the best of luck with your project.

  • NagiiNagii BRMember ✭✭

    @ClintStLaurent said:
    I wish you the best of luck with your project.

    Ah never made college I'm not learning watching video lessons the courses here in Brazil and shit started yesterday

    Thank you: D

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    @Nagii said:
    Ah never made college

    Me neither.

  • NagiiNagii BRMember ✭✭

    @ClintStLaurent said:

    @Nagii said:
    Ah never made college

    Me neither.

    So you know there are not many good video lessons. And by the way C # manja.
    If it were for you, a question where you should look for debugging

    Thanks: D

  • NagiiNagii BRMember ✭✭

    @ClintStLaurent said:
    I'm afraid I'm only understanding about half of what you're saying.
    As for video lessons... YouTube does have many of the official Xamarin lessons. But beyond the official videos, I wouldn't waste my time video tutorials. The Xamarin site has hundreds of tutorials.

    Getting started Xamarin site page

    Creating mobile apps in Xamarin - Free ebook download - the de facto textbook for Xamarin.

    There are THOUSANDS of XAML tutorials. You don't have to limit yourself to Xamarin. MVVM is the same for WPF as Xamarin. And all the WPF concepts are the same with only minor differences.

    1. Revisiting MVVM - The 30,000 ft view
    2. Introduction to data binding
    3. Data binding basics
    4. Getting started with MVVM
    5. https://channel9.msdn.com/Shows/XamarinShow/Introduction-to-MVVM

    Thank you !!

  • NagiiNagii BRMember ✭✭

    @ClintStLaurent said:
    I'm afraid I'm only understanding about half of what you're saying.
    As for video lessons... YouTube does have many of the official Xamarin lessons. But beyond the official videos, I wouldn't waste my time video tutorials. The Xamarin site has hundreds of tutorials.

    Getting started Xamarin site page

    Creating mobile apps in Xamarin - Free ebook download - the de facto textbook for Xamarin.

    There are THOUSANDS of XAML tutorials. You don't have to limit yourself to Xamarin. MVVM is the same for WPF as Xamarin. And all the WPF concepts are the same with only minor differences.

    1. Revisiting MVVM - The 30,000 ft view
    2. Introduction to data binding
    3. Data binding basics
    4. Getting started with MVVM
    5. https://channel9.msdn.com/Shows/XamarinShow/Introduction-to-MVVM

    I found the problem

    • Delete the BINS and OBJ folders of all projects then restore the packages!

    I'll see the links you sent. I'm going to study this weekend, thank you: D

  • Pamelarios.2249Pamelarios.2249 USUniversity ✭✭

    I got the same problem . so is this your solution , did it work ? Thanks
    Delete the BINS and OBJ folders of all projects then restore the packages!

Sign In or Register to comment.