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

[Bug]: `satelliteCount` and `satellitesUsedInFix` always 0

Open LorenzSchueler opened this issue 10 months ago • 4 comments

Please check the following before submitting a new issue.

Please select affected platform(s)

  • [X] Android
  • [ ] iOS
  • [ ] Linux
  • [ ] macOS
  • [ ] Web
  • [ ] Windows

Steps to reproduce

  1. enable GPS
  2. allow all required permissions
  3. start location stream (getPositionStream)

Expected results

Once the phone has a GPS fix, satelliteCount and satellitesUsedInFix should be > 0. To verify that the phone has a GPS fix, I use the app GPS Status (which also shows the total number of satellites and the number of satellites used for the fix).

Actual results

both satelliteCount and satellitesUsedInFix are always 0

Version

geolocator: 11.0.0 geolocator_android: 4.5.4

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.19.3, on Debian GNU/Linux trixie/sid 6.6.15-amd64, locale en_US.UTF-8)
    • Flutter version 3.19.3 on channel stable at /home/lorenz/.flutter-git/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ba39319843 (5 weeks ago), 2024-03-07 15:22:21 -0600
    • Engine revision 2e4ba9c6fb
    • Dart version 3.3.1
    • DevTools version 2.31.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/lorenz/Android/Sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at:
      /var/lib/flatpak/app/com.google.AndroidStudio/current/active/files/extra/android-studio/jbr/bin/ja
      va
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /usr/bin/chromium

[✓] Linux toolchain - develop for Linux desktop
    • Debian clang version 16.0.6 (20)
    • cmake version 3.28.3
    • ninja version 1.11.1
    • pkg-config version 1.8.1

[!] Android Studio (version unknown)
    • Android Studio at
      /var/lib/flatpak/app/com.google.AndroidStudio/current/active/files/extra/android-studio
    • 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
    ✗ Unable to determine Android Studio version.
    • android-studio-dir =
      /var/lib/flatpak/app/com.google.AndroidStudio/current/active/files/extra/android-studio
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)

[✓] VS Code (version 1.88.0)
    • VS Code at /var/lib/flatpak/app/com.visualstudio.code/x86_64/stable/active/files/extra/vscode
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available)
    • Mi MIX 2 (mobile) • b153e0d6 • android-arm64  • Android 14 (API 34)
    • Linux (desktop)   • linux    • linux-x64      • Debian GNU/Linux trixie/sid 6.6.15-amd64
    • Chrome (web)      • chrome   • web-javascript • Chromium 123.0.6312.105 built on Debian
      trixie/sid, running on Debian trixie/sid

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

! Doctor found issues in 1 category.

LorenzSchueler avatar Apr 14 '24 08:04 LorenzSchueler

Dear @LorenzSchueler,

Can you send us your LocationSettings?

Kind regards,

TimHoogstrate avatar Apr 22 '24 12:04 TimHoogstrate

Sure

AndroidSettings(
  forceLocationManager: true,
  foregroundNotificationConfig: const ForegroundNotificationConfig(
    notificationTitle: "Tracking",
    notificationText: "GPS tracking is active",
    color: Colors.red,
    notificationIcon: AndroidResource(name: "notification_icon"),
    setOngoing: true,
    enableWakeLock: true,
  ),
);

LorenzSchueler avatar Apr 22 '24 14:04 LorenzSchueler

Dear @LorenzSchueler,

Only when you set the forceLocationClient to false your data will be enriched with NMEA data. I'll label this as an enhancement, because it seems that this is not well documented.

Kind regards,

TimHoogstrate avatar Apr 24 '24 07:04 TimHoogstrate

Thanks for looking into this. Unfortunately even if I set forceLocationManager: false (and using a phone with Google Play Services) both numbers are still 0. I'm currently using the package location but I'd like to switch to geolocator. However the location package is able to provide the number of satellites (even without Google Play Services, hence probably using the LocationManager interface).

LorenzSchueler avatar Apr 24 '24 07:04 LorenzSchueler