[Bug]: TimeoutException after 0:00:10.000000: Future not completed
Please check the following before submitting a new issue.
- [X] I have searched the existing issues.
- [X] I have carefully read the documentation and verified I have added the required platform-specific configuration.
Please select affected platform(s)
- [X] Android
- [ ] iOS
- [ ] Linux
- [ ] macOS
- [ ] Web
- [ ] Windows
Steps to reproduce
Use the getCurrentPosition method with the following code: userPositionData = await Geolocator.getCurrentPosition( locationSettings: LocationSettings( accuracy: LocationAccuracy.high, distanceFilter: 10, timeLimit: const Duration(seconds: 10), ));
I don't want a limit I want to connect the user's location in my app but on an Android Redmi(Android 13) device it will not get the user's current location
Expected results
want to connect in every device
Actual results
I do not want to timeout my app content force location tracking so for this issue my app was stuck
Code sample
userPositionData = await Geolocator.getCurrentPosition( locationSettings: LocationSettings( accuracy: LocationAccuracy.high, distanceFilter: 10, timeLimit: const Duration(seconds: 10), ));
Screenshots or video
Screenshots or video demonstration
[Upload media here]
Version
geolocator: ^13.0.2
Flutter Doctor output
flutter --version Flutter 3.24.5 • channel stable • https://github.com/flutter/flutter.git Framework • revision dec2ee5c1f (12 days ago) • 2024-11-13 11:13:06 -0800 Engine • revision a18df97ca5 Tools • Dart 3.5.4 • DevTools 2.37.3
I got this error in my app. The future has not been completed for a long time. If you fix the error, let me know.
temporary solution the error was in the ios simulator. I changed simulator location settings to custom location value and error fixed.
I’m experiencing the same issue when running on the iOS simulator. The location request doesn't seem to work as expected. Has anyone found a workaround or a potential fix for this?
I’m experiencing the same issue when running on the iOS simulator. The location request doesn't seem to work as expected. Has anyone found a workaround or a potential fix for this?
Hello @br-programmer In iOS, I’m not facing any issues. Please verify it on a real device.
Hi,I also had this problem on my android test machine, my realMe phone model: RMX 3357, android version: 13. It doesn't work. Also my vivo Y10, android version: 11, it doesn't work either. But it does work on the iOS. Please help to look at this question, because I have the same situation as the author of this question, thank you.
@jenilAipxperts,
Please play around with the location settings, if you are testing indoor or outside would also generate different results. Try to lower the accuracy and distance filter first.
Kind regards,
@TimHoogstrate Still facing same issue i tried low and lowest both but still I am getting same error
@TimHoogstrate Any Update?
@TimHoogstrate Any Update? do you have WeChat?We can add friends to communicate
Same issue. My phone is IQOO 13 with android 15 from Vivo.
Pixel 8 Android 14
Also can not get position with await Geolocator.getCurrentPosition().
Without timeLimit, await this means forever waiting.
Im sure location service and permissions went well, and other app can locate my position immeditly.
iOS works.
mee too
After some test, GMS phone can't get position in China, after I solved "network connection" problem, it works.
经过一番测试,GMS手机在中国无法定位,解决“网络连接”问题后,就可以了。
这个是怎么解决的呢,我测试过华为、小米、还有其它机型,貌似只要没有Google服务的都不行
I have the same situation as the author of this question
I have the same issue.
On devices such as iPhone, Xiaomi, and Huawei, Geolocator.getCurrentPosition can return the longitude and latitude normally.
But on Vivo devices, the longitude and latitude cannot be obtained.
@langyuxiansheng 解决了吗?
这是因为geo用的谷歌地图,国内访问不了,你试试翻墙看看,翻墙应该是没有问题的。
猫吃小鱼干 @.***
------------------ 原始邮件 ------------------ 发件人: "Baseflow/flutter-geolocator" @.>; 发送时间: 2025年2月8日(星期六) 下午3:16 @.>; @.@.>; 主题: Re: [Baseflow/flutter-geolocator] [Bug]: TimeoutException after 0:00:10.000000: Future not completed (Issue #1611)
@langyuxiansheng 解决了吗?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
这是因为geo用的谷歌地图,国内访问不了,你试试翻墙看看,翻墙应该是没有问题的。
猫吃小鱼干 @.***
…
但是正常用户谁会去翻墙呀。。。 大部分使用APP的用户可能都是普通用户,特别是国内的。
我也遇到了 小米红米不行 华为和iOS可以
Im getting this constantly on iOS on the second+ time opening the app. on the first time, the app prompts location permission. any other time it just hangs and if i add timeout, it fails with timeout error
Adding <uses-permission android:name="android.permission.INTERNET" /> did it for me
In China on android phone, still not working. But use native project method it can get position.
In China on android phone, still not working. But use native project method it can get position.
Yes,only use native project method it can get position. in china
这是因为geo用的谷歌地图,国内访问不了,你试试翻墙看看,翻墙应该是没有问题的。 猫吃小鱼干 @.*** …
但是正常用户谁会去翻墙呀。。。 大部分使用APP的用户可能都是普通用户,特别是国内的。
你只能使用安卓原生去写,然后传给flutter了。我们是海外的项目,在国内开发,所以才需要翻墙
Any package recommend if need use in China, except baidu and Amap, those are two heavy, only need to get location.