NativeScript / nativescript-geolocation

Geolocation plugin to use for getting current location, monitor movement, etc
Apache License 2.0
139 stars 76 forks source link

Error: Cannot retrieve current location #190

Closed kaurag007ph closed 5 years ago

kaurag007ph commented 5 years ago

An issue with retrieving current location on Physical Android device and only happens on a specific phone. This happens even location service enabled and has access permission.

And it works well on iOS device.

Actual error message: "Cannot retrieve current location"

tbozhikov commented 5 years ago

Hi @kaurag007ph, please provide some details on the issue. Refer the issue template here and give us as many details as possible. This will help everyone with the eventual resolution. Thanks.

merianos commented 5 years ago

I have the same issue.

In my case, I have two physical devices, an OnePlus One and one Huawei Mate 10Pro.

This is the first time I use the native script online editor, and Ι try to follow the online available tutorial. In my source code I have the following code:

getMyWeather() {
    Geolocation.enableLocationRequest();
    let promise = Geolocation.getCurrentLocation({
        desiredAccuracy: Accuracy.any,
        maximumAge: 5000,
        updateDistance: 0.1,
        timeout: 20000
    });

    console.log( 'Promise: ', typeof promise, promise )
},

and the console output is like that:

// ...
[HUAWEI Mate 10 Pro]: 'Promise: ' 'object' {}
// ....
[OnePlus One]: 'Promise: ' 'object' {}
// ....
tbozhikov commented 5 years ago

@merianos Could you please send us the playground link, so we can test the exact scenario? Thanks in advance!

tbozhikov commented 5 years ago

Closing due to inactivity