-
Notifications
You must be signed in to change notification settings - Fork 85
GetPositionAsync always cancelling task #16
Comments
Have you tried longer timeouts or a different I was not able to reproduce this error with any of the Galaxy S3 or S4 variants. |
Hi @ermau. I have just tried using different values:
instead of my default ones:
but the result still the same. One thing that is making me confused is that this morning, one of my beta testers installed my app and all localization features were working inside his Samsung Galaxy S3. I am now wondering why it is happening inside some devices (including mine) and not happening inside others. I have double checked the Location configurations inside my device:
By turning some of them off I received an error from the component which is right, but when turning then back to on I restarted receiving a canceled task. Am I missing to check something inside my device? |
It is unbelievable I was two weeks without restarting my device. Right after restarting it, all localizations features started to work again. It appears to be an Android Bug. |
Were geolocation services working in any other app before you restarted it though? |
Yes, I was able to use both Google Maps application and the Google Play Services Rev. 12 component (inside my app). Maybe because of this I did not think about restart the device. |
So either there's a bug in XM or there's a bug in Android and Google is cheating somehow. Hard to really narrow down at this stage. |
Yes, the good point is that it is not a blocker issue anymore, I am now able to publish my Android App this weekend. I am going to try to figure it out how can I reproduce the problem on my device and then I can return and post the results here. But thank in advance @ermau for the support. |
Hi @ermau. I am writing to you this time because I have lots of users complaining about not having their location found by my application and so their are given bad rates to it. Others that didn't face this issue are always given good rates. Whenever I can I am answering them to restart their devices and so, hopefully, they will be able to use the app. Did you see somebody else facing this problem as well? I really need at least a workaround to this issue. May you share some thoughts with me? Maybe I need to start using a geoip service or try to use some native Android API to get current users location? What would you do? If you would like to try using my app, I can share its Google Play url. Thanks in advance. |
Hi @ermau, look to this thread: https://code.google.com/p/android/issues/detail?id=57707 it may be the reason for this problem. |
It seems like I was right originally, it appears to be a bug in the built in location providers and Google is using a completely different one via Google Play Services. I would recommend giving Google Play Services a shot and seeing if that solves your issue. If the built in stuff is going to continue to fail, we may have to switch X.M to use it as well. |
Hi, is there any update on this issue? I'm getting the same exact error in a Xamarin Forms project on Windows Phone: I've created a wrapper class in the Windows Phone project that simply retrieves the user's position using Xamarin Mobile.
Then, by using the DependencyService, I retrieve the instance of my wrapper in the PCL shared project: however, whenever I launch the application on Windows Phone and I call the GetPositionAsync() method of the Geolocator class, I get a "TaskCanceledException - A task has been canceled". |
https://gist.github.com/supreettare/0433e34f9fdf4d750bb2 This code fixes the TaskCancelledException on android. After rewriting the code this way, I never got the exception again. |
@supreettare Can you post the sample of your project? Even I am trying to create a Dependency service to access the co-ordinates to process without displaying the data on the UI for android devices... |
please @supreettare , can you post the same of your project? thanks |
Originally submitted by @georgepiva on issue #6
I can see this happening on both Xamarin.Mobile component 0.6.3 and 0.7 versions. It also happens when downloading the master branch of this repository as a Zip file and importing it inside my project.
I have just tried to run the GeolocationSample project on a Samsung Galaxy S3 and got the same results:
My beta testers are also notifying me about this localization issue and they are using different devices from me.
The text was updated successfully, but these errors were encountered: