phonegap geolocation always fail on timeout phonegap geolocation always fail on timeout android android

phonegap geolocation always fail on timeout


I know that maybe it is too late, but today i struggled with the same issue! The solution turned out to be very simple!

SOLUTION: Reboot the device.

That's all.

The problem is, that you never know when i user will get this kind of bug, so if your application relies heavily on geolocation i recommend you set a timeout in location options navigator.geolocation.getCurrentPosition(geoSuccess, geoError, {timeout: 15000}) and alert user about the problem and possible solution.

P.S.Keep in mind, that Geolocation can timeout for example if mobile data is turned off too, so reboot won't always fix it. On iPhone it uses cellular data to get your position, but on Android, it looks like the phone does not have access to cellular data unless 3G is turned on


It could sound stupid, but, did you activate the "Use Networks" option?

Go to Settings -> Location and security -> Use networks; and active it. I have passed all the afternoon watching the problem and it was that.


I restarted and restarted. I reset my phone to factory settings.

But nothing worked.

Until I set enablHighAccuracy from true to false.

And... Tada.... it works.

So :

var options;options = {    maximumAge: 30000,    timeout: 5000,    enableHighAccuracy: false};

This used to work fine using PhoneGap 2.6.0. I needed to make this change since I'm now using Phonegap 3.3 - tested on a Wiko Cink+ phone.