You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have carefully read the documentation and verified I have added the required platform specific configuration.
Please select affected platform(s)
Android
iOS
Linux
macOS
Web
Windows
Steps to reproduce
Start GPS scream using Geolocator.getPositionStream
Start cycling / walking etc..
Distance is not registered
It seems to happen only on certain Android devices.
Expected results
Distance is registered along the way.
Actual results
No distance registered.
Code sample
Code sample
voidstartPositionStream({
requiredvoidFunction(Position) onPositionChanged,
requiredFunction onError,
}) async {
// Cancel stream, if there is anyawaitcancelPositionStream();
// Start listening to the position stream
_positionSubscription =Geolocator.getPositionStream(
locationSettings:_initializeLocationSettings(),
).listen(
onPositionChanged,
onError: onError,
);
}
void_onPositionChanged(Position position) {
gpsPositions.add(position);
gpsPositions = _gpsFilterService.filterOutAnomalyPoints(
positions: gpsPositions, activityType: _challengeActivityType);
// Calculate distancedouble totalDistance = _gpsAPI.calculateDistance(
positions: gpsPositions,
);
// Add to sinkfinalGpsModel gpsModel = _gpsModel.cloneSettingsAndMeters(
meters: totalDistance,
);
gpsStreamController.sink.add(gpsModel);
}
doublecalculateDistance({
requiredList<Position> positions,
}) {
double totalDistance =0;
if (positions.length <2) {
return totalDistance;
}
for (int i =1; i < positions.length; i++) {
Position newPosition = positions[i];
Position oldPosition = positions[i -1];
totalDistance += _geolocatorPlatform.distanceBetween(
oldPosition.latitude,
oldPosition.longitude,
newPosition.latitude,
newPosition.longitude,
);
}
return totalDistance;
}
Screenshots or video
Screenshots or video demonstration
[Upload media here]
Version
11.0.0 (geolocator_android = 4.4.1)
Flutter Doctor output
Doctor output
```
[!] Flutter (Channel unknown, 3.10.0, on Microsoft Windows [Version 10.0.22631.3447], locale en-NL)
! Flutter version 3.10.0 on channel unknown at C:\flutter_windows_2.2.3-stable\flutter
Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
If that doesn't fix the issue, reinstall Flutter by following instructions at
https://flutter.dev/docs/get-started/install.
! Unknown upstream repository.
Reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
• Framework revision 84a1e904f4 (12 months ago), 2023-05-09 07:41:44 -0700
• Engine revision d44b5a94c9
• Dart version 3.0.0
• DevTools version 2.23.1
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to
perform update checks and upgrades.
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at C:\Users\bart_\AppData\Local\Android\sdk
• Platform android-34, build-tools 31.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio
• Android Studio at C:\Program Files\Android\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
• android-studio-dir = C:\Program Files\Android\Android Studio
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[√] VS Code (version 1.88.1)
• VS Code at C:\Users\bart_\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.88.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22631.3447]
• Chrome (web) • chrome • web-javascript • Google Chrome 124.0.6367.118
• Edge (web) • edge • web-javascript • Microsoft Edge 124.0.2478.67
[√] Network resources
• All expected network resources are available.
</details>
The text was updated successfully, but these errors were encountered:
Hey, we have the same issue with the same model, Pixel 6a.
We assume that the problem is caused by the absence of the sticky notification for location tracking. After the user accepts the notification permission, all notification channels are activated in the system settings EXCEPT the "Background Location". If you manually activate this channel and restart the app, the tracking notification is still not shown.
In addition, after you upload your app to Play Console with this permission declaration, you will have to fill Foreground service permissions policy under App content.
It would be great to add this new line to the current README.
On top of that we forced that our functionalities can only be used when "Always in use" is on. This was necessary since we use background location measurement.
Please check the following before submitting a new issue.
Please select affected platform(s)
Steps to reproduce
It seems to happen only on certain Android devices.
Expected results
Distance is registered along the way.
Actual results
No distance registered.
Code sample
Code sample
Screenshots or video
Screenshots or video demonstration
[Upload media here]
Version
11.0.0 (geolocator_android = 4.4.1)
Flutter Doctor output
Doctor output
``` [!] Flutter (Channel unknown, 3.10.0, on Microsoft Windows [Version 10.0.22631.3447], locale en-NL) ! Flutter version 3.10.0 on channel unknown at C:\flutter_windows_2.2.3-stable\flutter Currently on an unknown channel. Run `flutter channel` to switch to an official channel. If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install. ! Unknown upstream repository. Reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install. • Framework revision 84a1e904f4 (12 months ago), 2023-05-09 07:41:44 -0700 • Engine revision d44b5a94c9 • Dart version 3.0.0 • DevTools version 2.23.1 • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at C:\Users\bart_\AppData\Local\Android\sdk
• Platform android-34, build-tools 31.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2020.3)
• Android Studio at C:\Program Files\Android\Android Studio1
• 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.10+0-b96-7249189)
[√] Android Studio
• Android Studio at C:\Program Files\Android\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
• android-studio-dir = C:\Program Files\Android\Android Studio
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[√] VS Code (version 1.88.1)
• VS Code at C:\Users\bart_\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.88.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22631.3447]
• Chrome (web) • chrome • web-javascript • Google Chrome 124.0.6367.118
• Edge (web) • edge • web-javascript • Microsoft Edge 124.0.2478.67
[√] Network resources
• All expected network resources are available.
The text was updated successfully, but these errors were encountered: