Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: TimeoutException after 0:00:10.000000: Future not completed #1611

Open
3 of 8 tasks
jenilAipxperts opened this issue Nov 25, 2024 · 12 comments
Open
3 of 8 tasks
Assignees

Comments

@jenilAipxperts
Copy link

jenilAipxperts commented Nov 25, 2024

Please check the following before submitting a new issue.

Please select affected platform(s)

  • 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

@aarican1
Copy link

aarican1 commented Nov 28, 2024

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.

Ekran Resmi 2024-12-03 13 46 17

@br-programmer
Copy link

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?

@jenilAipxperts
Copy link
Author

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.

@longzhenqi
Copy link

image position = await _geolocatorPlatform .getCurrentPosition( locationSettings: const LocationSettings(timeLimit: Duration(seconds: 10))) .catchError((e) { });

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.

@TimHoogstrate
Copy link
Contributor

@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 TimHoogstrate self-assigned this Dec 3, 2024
@TimHoogstrate TimHoogstrate added the status: needs more info We need more information before we can continue work on this issue. label Dec 3, 2024
@jenilAipxperts
Copy link
Author

@TimHoogstrate
Still facing same issue i tried low and lowest both but still I am getting same error

@github-actions github-actions bot removed the status: needs more info We need more information before we can continue work on this issue. label Dec 3, 2024
@jenilAipxperts
Copy link
Author

@TimHoogstrate Any Update?

@longzhenqi
Copy link

@TimHoogstrate Any Update?
do you have WeChat?We can add friends to communicate

@elethiame
Copy link

Same issue.
My phone is IQOO 13 with android 15 from Vivo.

@iwpz
Copy link

iwpz commented Jan 3, 2025

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.

@lfclfc
Copy link

lfclfc commented Jan 3, 2025

mee too

@iwpz
Copy link

iwpz commented Jan 7, 2025

After some test, GMS phone can't get position in China, after I solved "network connection" problem, it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants