Forum Xamarin.Forms

Geolocation.GetLocationAsync Ok on debbuger, "I/Choreographer(21859): Skipped frames!" on device

jddjdd USMember ✭✭✭

When I try to get a location on the debugger everything is right.
If I try on the device with no permission, it catches an exception, ok.
If I try on the device with the permission, in output I get the message:

I/Choreographer(26545): Skipped 337 frames! The application may be doing too much work on its main thread.

This is my code:

        async public static System.Threading.Tasks.Task<Position> BuildPositionAsync()
        {
            try
            {
                var request = new GeolocationRequest(GeolocationAccuracy.High);
                var location = await Geolocation.GetLocationAsync(request); //
                return new Position(location);
            }
            catch (Exception ex)
            {
                return new Position();
            }
        }

Best Answer

  • jddjdd USMember ✭✭✭
    Accepted Answer

    I am silly. I was in a bulding and my device couldn't get the GPS location.
    So now I have to find out how to tell the user the device is waiting for the GPS location instead of freezing the app.

Answers

  • jddjdd USMember ✭✭✭
    Accepted Answer

    I am silly. I was in a bulding and my device couldn't get the GPS location.
    So now I have to find out how to tell the user the device is waiting for the GPS location instead of freezing the app.

Sign In or Register to comment.