Skip to content

[Bug]: Infinity loading and time out on getting current location #1708

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

Open
4 of 8 tasks
Samin-roadsurfer opened this issue May 26, 2025 · 2 comments
Open
4 of 8 tasks
Assignees

Comments

@Samin-roadsurfer
Copy link

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS
  • Linux
  • macOS
  • Web
  • Windows

Steps to reproduce

  1. I use real android/ios device
  2. I open the app and choose "Only this time"/"While using the app"
  3. it works most of the time for the first time, but if you clear the location and call it again it stucks.

Expected results

I expect location to be determined without any problems.

Actual results

Application loads infinitely since the location can not be determined and then time out.

also sometimes i try to get it frequently, i get :

D/permissions_handler(26103): No permissions found in manifest for: []25

Code sample

Code sample
await Geolocator.getCurrentPosition(
      locationSettings: const LocationSettings(
        accuracy: LocationAccuracy.medium,
        timeLimit: Duration(seconds: 20),
      ),
    );
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

Screenshots or video

Screenshots or video demonstration
MicrosoftTeams-video.8.mp4

Version

geolocator: ^14.0.0

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.29.3, on macOS 15.4 24E248 darwin-arm64, locale en-DE) [2.5s]
    • Flutter version 3.29.3 on channel stable at /Users/saminsheyda/fvm/versions/3.29.3
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ea121f8859 (6 weeks ago), 2025-04-11 19:10:07 +0000
    • Engine revision cf56914b32
    • Dart version 3.7.2
    • DevTools version 2.42.3

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0) [4.5s]
    • Android SDK at /Users/saminsheyda/Library/Android/sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.3) [7.0s]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16E140
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [11ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.2) [10ms]
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)

[✓] VS Code (version 1.83.1) [9ms]
    • VS Code at /Users/saminsheyda/Downloads/Visual Studio Code 2.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] VS Code (version 1.80.0) [9ms]
    • VS Code at /Users/saminsheyda/Downloads/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (5 available) [8.9s]
    • Samin Sheyda’s iPhone (mobile)  • 00008120-0012701026A1A01E            • ios            • iOS 18.5 22F76
    • iPhone 16 Pro (mobile)          • 9E564AC3-FE5C-49E9-B91E-4348E02BD034 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-18-1 (simulator)
    • macOS (desktop)                 • macos                                • darwin-arm64   • macOS 15.4 24E248 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad                • darwin         • macOS 15.4 24E248 darwin-arm64
    • Chrome (web)                    • chrome                               • web-javascript • Google Chrome 136.0.7103.114

[✓] Network resources [451ms]
    • All expected network resources are available.

• No issues found!
@TimHoogstrate
Copy link
Contributor

@Samin-roadsurfer,

Thanks for your issue, does this happen to iOS and Android, since they both have a different implementation. Can you try to test the same with the example app to see if you have a different outcome?

Kind regards,

@TimHoogstrate TimHoogstrate self-assigned this May 28, 2025
@TimHoogstrate TimHoogstrate added the status: needs more info We need more information before we can continue work on this issue. label May 28, 2025
@Samin-roadsurfer
Copy link
Author

Hey @TimHoogstrate thanks for checking the issue :)
here the debug result of example app with same code mentioned in the main issue:

android:
Image

ios:
could not reproduce the issue on example app for ios, but i do see it in my main app sometimes.

@github-actions github-actions bot removed the status: needs more info We need more information before we can continue work on this issue. label May 28, 2025
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

2 participants