ngCordova Geolocation Times out on Nexus 5 #743
Comments
I have the same Issue with Android 4.4.4 API 19 |
I am the same problems with Nexus 5 android 5.0.0 API 21. I have test also with my galaxy note 8 and it still giving the same message even I have 1 minutes for timeout. |
I spent hours today struggling with this issue. Geolocation kept timing out on android 5.0 and 5.1. Installing version 1.0 of the cordova geolocation plugin (I had version 0.3.x before) did it for me. According to [https://issues.apache.org/jira/browse/CB-5977](this link), this version only adds the required location permissions to the AndroidManifest.xml file, and leaves the rest of the work to the Web geolocation API instead of the device's native one. So, cordova plugin rm org.apache.cordova.geolocation
cordova plugin add cordova-plugin-geolocation Then just use the Web API : navigator.geolocation.getCurrentPosition(
successCallback,
errorCallback,
options
); Hope this helps |
same issue here, I am not getting working. I am using |
I manually modified the /plugins/android.json file, the plugin didn't add itself to this file. The config.xml and AndroidManifest.xml are overwritten by this JSON plugin v0.3.12
|
Adding on as another case where the geolocation is failing. Running Android 5.1 with Location turned on (I can see the app as a requestor when looking at my Locations permissions). Using the web API does not solve the issue, either. |
Did anybody got the solution for this problem. I'm also facing the same problem. |
I had this problem, you need to add the whitelist plugin to the project and this to your main html file |
Hi digitalbath, I addded your meta tag in my html file.. Eventhough it is showing timeout error... If the internet connection is on with gps , the location is shown..But without internet it is not fetching the location. |
if anyone is facing same issue and using ionic then just remove and install the plugin using ionic not cordova , why?... not sure! but i think it only works if added to package.json and it wont be added unless we run ionic not cordova , not sure but anyway it works for me! |
Tried every recommendation above including those mention on stack overflow. nothing works. I am using API 23 |
@zmijevik Can you include a codepen that reproduces the issue? Or link to a minimal github repo that reproduces the issue? |
@gortok It turns out that geolocation only works when high_accuracy is enabled. I had it disabled all this time because I thought it was contributing to the error:
|
Also the same problem here using Ionic and the cordova-plugin-geolocation.
Basic outline of code I'm using: (Note: I'm using a custom api for the google map)
|
Can somebody simply confirm that it's not possible ? I can't find a way to make it works. |
Any solution yet ? Its been so many days i am struggling with this issue ! any possible alternatives? |
UP |
17 Developers between 2 different company headquarters AND NONE of us can get this plugin to work. Followed every "mod" and "tweak" out there. Giving up + creating a custom java plugin instead. What a waste of time and money |
I had a similar problem for the last couple of days. Using Ionic and ngCordova, $cordovaGeolocation getCurrentPosition method timed out when testing it on a Nexus 4 device. It did, however, work flawlessly on iPhone. Hope this helps someone. |
@AlexMilmanGitHub That could totally be it. I'm going to have to try this now. Will update if I can confirm. |
Has anybody solved this problem? |
@AlexMilmanGitHub i always have sim card in phone and internet connection i use is from wifi. Plugin works every time i test it on 4.4 device but fails on 4.2 device. |
Has anybody solved this problem? |
Seems @AlexMilmanGitHub is right. I tried to run the test on a Nexus 7 tablet and I had the same Timeout Error. However, I tried on an Infinix Hot 3(Lollipop) and a Samsung S7 edge(Marshmallow), both with SIMs and it worked fine without issues. |
SIM card did it for me. Couldn't get it to work otherwise. |
I found this issue affecting specific manufacturers, like xiaomi and gionee. For the rest it is working fine. I am using Cordova v6.3, some one please help |
I'm facing the same problems :-( br |
I also encountered this on a Nexus device. It means that we have had to scrap developing the app in the Ionic / Cordova environment. It is not fit for purpose when certain phones are unable to use such a core function as GPS. |
:-/ but what is so hard on this, other android seem to support native GPS without any network connection? |
@tommydudehead have you tried this https://www.npmjs.com/package/cordova-plugin-advanced-geolocation? |
@tommydudehead it worked :-) |
Tests on my Nexus7 (2013 - android 6.0.1) show that "high accuracy mode" must be selected in android location settings, (device only - gps) will not work. The problem, as I understand is that ngcordova uses geolocation feature of webview, which is only available in 'high accuracy mode'. |
I've tried cordova-plugin-geolocation with ngCordova but it always returned me Timeout error, meaning it can't get device's position in my even 5 minutes set timeout, so the final solution for Android 5.1 at least:
it wasn't working without |
Hey @MikhailRoot Thanks man adding permissions in AndroidManifest.xml worked for me... |
any one have a working example please ? I added the permissions in AndroidManifest.xml |
I'm having the same issue with a moto g4 plus with android 7 (nougat), always with a sim card, high precision GPS, high accuracy, I've tried practically everything you guys said but always get a timeout... Geolocation works fine on other devices with lollipop and used to work fine on marshmallow on the same device (moto g4 was recently updated from marshmallow to nougat). Also working fine on iOS. There are no warnings and no traces, only the timeout error. |
in my case it work now, my GPS phone bug ( on all gps application, jumping from place to place after a recent falldown). i restart my device and it work |
@alainib Thanks man, I restarted the device and everything works again! |
@alainib thanks Man, I restarted my mobile and It is working very fine with enableHighAccuracy: false/true |
i want to share my experience with u , after android M.M android set many restrictions , like restrict in fetching mac id only (000000000000) is hard-coded and locations etc., i was using same geo location fetching phonegap plugin , and was getting timeout again and again, than i found one solution. just go on google maps app and location sharing option from side navigation and allow your location to share. than again open your app again and you will find exact lat long of your device. could be i am wrong but just sharing my R&D with u . thanks |
Anybody fix timeout error PositionError {code: 3, message: "Timeout expired"} in the console.it occur only if GPS off then ON the GPS its working in such case? |
I'm testing the ngCordova Geolocation service on a Nexus 5 and it is timing out every time.
Phone: Nexus 5 with Android Lollipop 5.1
ngCordova Version: v0.1.12-alpha
Location Services: Turned on with Battery Saving Mode
Run Environment: ionic run android -l (using LiveReload)
Here is the error:
and here is my code (nothing special):
Anyone know why this is happening? Same code is working on One Plus One and Samsung devices though.
The text was updated successfully, but these errors were encountered: