flutter-geolocator icon indicating copy to clipboard operation
flutter-geolocator copied to clipboard

Geolocator does not return coordinate

Open wanoghoco opened this issue 3 years ago • 4 comments

Geolocator does not return coordinate sometimes in android 11, it just returns error after a while.

And sometimes it returns wrong coordinate if I don't forceAndroidLocationManager and sometimes, the location icon does not come up on my Device, sometimes it comes

**Version: 8.0.3

Platform:

wanoghoco avatar Jan 18 '22 14:01 wanoghoco

Sorry to say but you don't really provide a lot of information which makes it really hard for us to help. In your issue report you mentioned:

Geolocator does not return coordinate sometimes in android 11, it just returns error after a while.

Please post the error details (stack trace + log information). If you run the App from your PC/ Mac you can use the -v flag to receive verbose logging:

flutter run -v -d <device_id>

Note: replace the <device_id> with your actual device identifier (you can retrieve it using the flutter devices command).

Together with the error details please also provide the following information:

  1. The output of the flutter doctor -v command;
  2. Provide information about the device you are testing with (emulator or real device, make en model);
  3. The contents of the android/app/src/main/AndroidManifest.xml file (IMPORTANT: remove or replace sensitive information);
  4. Clear steps we can use to reproduce the issue (preferably accompanied with sample code on how you are calling the geolocator).

mvanbeusekom avatar Jan 31 '22 14:01 mvanbeusekom

And sometimes it returns wrong coordinate if I don't forceAndroidLocationManager

This is possible, the Android FusedLocationProviderClient makes use of several sensors and API's to try and acquire a location. If it cannot acquire a GPS fix it will might try to triangulate your location using the cellular network which is often not precise. In other cases it might use information from a WiFi network or Bluetooth connections, which all might not be accurate.

Of course there is also the possibility that the GPS chip in the device is malfunctioning, if you have the opportunity try testing on an other device as well.

mvanbeusekom avatar Jan 31 '22 15:01 mvanbeusekom

Hello,

i'm facing the same issue with the "example" project from the lib. I works fine on android emulators but with several physical devices ( including OnePlus 6T Android 10 and a Galaxy A25S Android 11 ) getCurrentPosition just never returns.

When tapping on the "location" icon it display "Permission granted" and stops here, no logs are displayed ( event with -v option )

Tell me if you need any other information, and thanks for the plugin !

Here is my flutter doctor -v

[✓] Flutter (Channel stable, 2.8.1, on macOS 11.6.2 20G314 darwin-x64, locale fr-FR)
    • Flutter version 2.8.1 at /Users/jocelyn_griselle/fvm/versions/2.8.1
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (7 weeks ago), 2021-12-16 08:37:33 -0800
    • Engine revision 890a5fca2e
    • Dart version 2.15.1

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/jocelyn_griselle/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/jocelyn_griselle/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

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

[✓] Android Studio (version 2021.1)
    • 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 11.0.11+0-b60-7590822)

[✓] IntelliJ IDEA Community Edition (version 2021.2.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin version 212.5486

[✓] VS Code (version 1.63.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.32.0

[✓] Connected device (3 available)
    • ONEPLUS A6010 (mobile)  • 667a9449      • android-arm64  • Android 10 (API 29)
    • sdk gphone x86 (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • Chrome (web)            • chrome        • web-javascript • Google Chrome 97.0.4692.99

• No issues found!

jo11yn avatar Feb 01 '22 10:02 jo11yn

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

no-response[bot] avatar Feb 14 '22 14:02 no-response[bot]

I am closing this issue as no new information has surfaced since the reopening.

JeroenWeener avatar Sep 15 '23 11:09 JeroenWeener