[X] I have carefully read the documentation and verified I have added the required platform specific configuration.
Please select affected platform(s)
[X] Android
[ ] iOS
[ ] Linux
[ ] macOS
[ ] Web
[ ] Windows
Steps to reproduce
Request permissions (Manifest contains both coarse and fine)
On device select to only share approximate location while in use (while in use might not be necessary)
When requesting the positions stream the app crashes:
E/AndroidRuntime(23703): FATAL EXCEPTION: main E/AndroidRuntime(23703): Process: ro.a24assitance.app, PID: 23703 E/AndroidRuntime(23703): java.lang.SecurityException: Neither user 10473 nor current process has android.permission.ACCESS_FINE_LOCATION. E/AndroidRuntime(23703): at android.os.Parcel.createExceptionOrNull(Parcel.java:3069) E/AndroidRuntime(23703): at android.os.Parcel.createException(Parcel.java:3053) E/AndroidRuntime(23703): at android.os.Parcel.readException(Parcel.java:3036) E/AndroidRuntime(23703): at android.os.Parcel.readException(Parcel.java:2978) E/AndroidRuntime(23703): at android.location.ILocationManager$Stub$Proxy.registerGnssNmeaCallback(ILocationManager.java:1675) E/AndroidRuntime(23703): at android.location.LocationManager$GnssNmeaTransportManager.registerTransport(LocationManager.java:3125) E/AndroidRuntime(23703): at android.location.LocationManager$GnssNmeaTransportManager.registerTransport(LocationManager.java:3115) E/AndroidRuntime(23703): at com.android.internal.listeners.ListenerTransportManager.addListener(ListenerTransportManager.java:70) E/AndroidRuntime(23703): at android.location.LocationManager.addNmeaListener(LocationManager.java:2612) E/AndroidRuntime(23703): at android.location.LocationManager.addNmeaListener(LocationManager.java:2593) E/AndroidRuntime(23703): at com.baseflow.geolocator.location.NmeaClient.start(NmeaClient.java:76) E/AndroidRuntime(23703): at com.baseflow.geolocator.location.FusedLocationClient.requestPositionUpdates(FusedLocationClient.java:157) E/AndroidRuntime(23703): at com.baseflow.geolocator.location.FusedLocationClient.lambda$startPositionUpdates$2$com-baseflow-geolocator-location-FusedLocationClient(FusedLocationClient.java:240) E/AndroidRuntime(23703): at com.baseflow.geolocator.location.FusedLocationClient$$ExternalSyntheticLambda2.onSuccess(Unknown Source:4) E/AndroidRuntime(23703): at com.google.android.gms.tasks.zzm.run(com.google.android.gms:play-services-tasks@@18.1.0:1) E/AndroidRuntime(23703): at android.os.Handler.handleCallback(Handler.java:958) E/AndroidRuntime(23703): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime(23703): at android.os.Looper.loopOnce(Looper.java:230) E/AndroidRuntime(23703): at android.os.Looper.loop(Looper.java:319) E/AndroidRuntime(23703): at android.app.ActivityThread.main(ActivityThread.java:8918) E/AndroidRuntime(23703): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(23703): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608) E/AndroidRuntime(23703): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103) E/AndroidRuntime(23703): Caused by: android.os.RemoteException: Remote stack trace: E/AndroidRuntime(23703): at android.app.ContextImpl.enforce(ContextImpl.java:2418) E/AndroidRuntime(23703): at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:2446) E/AndroidRuntime(23703): at com.android.server.location.gnss.GnssManagerService.registerGnssNmeaCallback(GnssManagerService.java:217) E/AndroidRuntime(23703): at com.android.server.location.LocationManagerService.registerGnssNmeaCallback(LocationManagerService.java:1373) E/AndroidRuntime(23703): at android.location.ILocationManager$Stub.onTransact(ILocationManager.java:832)
Expected results
Ideally we should be getting periodic updates from the approximate location.
Actual results
The app crashes.
Code sample
Code sample
```dart
if (await Geolocator.isLocationServiceEnabled()) {
var permission = await Geolocator.checkPermission();
if (permission == LocationPermission.denied || permission == LocationPermission.unableToDetermine) {
permission = await Geolocator.requestPermission();
}
if (permission == LocationPermission.denied || permission == LocationPermission.deniedForever) {
return;
}
final position = await Geolocator.getLastKnownPosition();
if (position != null) {
//handle position
}
_subscription = Geolocator.getPositionStream().listen(
(position) {
//handle position update
},
);
} else {
//no location
}
```
Screenshots or video
Screenshots or video demonstration
[Upload media here]
Version
12.0.0
Flutter Doctor output
Doctor output
```console
[√] Flutter (Channel stable, 3.22.1, on Microsoft Windows [Version 10.0.22631.3593], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.5.2)
[√] Android Studio (version 2023.3)
[√] VS Code (version 1.89.1)
[√] Connected device (4 available)
[√] Network resources
```
Please check the following before submitting a new issue.
Please select affected platform(s)
Steps to reproduce
E/AndroidRuntime(23703): FATAL EXCEPTION: main E/AndroidRuntime(23703): Process: ro.a24assitance.app, PID: 23703 E/AndroidRuntime(23703): java.lang.SecurityException: Neither user 10473 nor current process has android.permission.ACCESS_FINE_LOCATION. E/AndroidRuntime(23703): at android.os.Parcel.createExceptionOrNull(Parcel.java:3069) E/AndroidRuntime(23703): at android.os.Parcel.createException(Parcel.java:3053) E/AndroidRuntime(23703): at android.os.Parcel.readException(Parcel.java:3036) E/AndroidRuntime(23703): at android.os.Parcel.readException(Parcel.java:2978) E/AndroidRuntime(23703): at android.location.ILocationManager$Stub$Proxy.registerGnssNmeaCallback(ILocationManager.java:1675) E/AndroidRuntime(23703): at android.location.LocationManager$GnssNmeaTransportManager.registerTransport(LocationManager.java:3125) E/AndroidRuntime(23703): at android.location.LocationManager$GnssNmeaTransportManager.registerTransport(LocationManager.java:3115) E/AndroidRuntime(23703): at com.android.internal.listeners.ListenerTransportManager.addListener(ListenerTransportManager.java:70) E/AndroidRuntime(23703): at android.location.LocationManager.addNmeaListener(LocationManager.java:2612) E/AndroidRuntime(23703): at android.location.LocationManager.addNmeaListener(LocationManager.java:2593) E/AndroidRuntime(23703): at com.baseflow.geolocator.location.NmeaClient.start(NmeaClient.java:76) E/AndroidRuntime(23703): at com.baseflow.geolocator.location.FusedLocationClient.requestPositionUpdates(FusedLocationClient.java:157) E/AndroidRuntime(23703): at com.baseflow.geolocator.location.FusedLocationClient.lambda$startPositionUpdates$2$com-baseflow-geolocator-location-FusedLocationClient(FusedLocationClient.java:240) E/AndroidRuntime(23703): at com.baseflow.geolocator.location.FusedLocationClient$$ExternalSyntheticLambda2.onSuccess(Unknown Source:4) E/AndroidRuntime(23703): at com.google.android.gms.tasks.zzm.run(com.google.android.gms:play-services-tasks@@18.1.0:1) E/AndroidRuntime(23703): at android.os.Handler.handleCallback(Handler.java:958) E/AndroidRuntime(23703): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime(23703): at android.os.Looper.loopOnce(Looper.java:230) E/AndroidRuntime(23703): at android.os.Looper.loop(Looper.java:319) E/AndroidRuntime(23703): at android.app.ActivityThread.main(ActivityThread.java:8918) E/AndroidRuntime(23703): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(23703): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608) E/AndroidRuntime(23703): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103) E/AndroidRuntime(23703): Caused by: android.os.RemoteException: Remote stack trace: E/AndroidRuntime(23703): at android.app.ContextImpl.enforce(ContextImpl.java:2418) E/AndroidRuntime(23703): at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:2446) E/AndroidRuntime(23703): at com.android.server.location.gnss.GnssManagerService.registerGnssNmeaCallback(GnssManagerService.java:217) E/AndroidRuntime(23703): at com.android.server.location.LocationManagerService.registerGnssNmeaCallback(LocationManagerService.java:1373) E/AndroidRuntime(23703): at android.location.ILocationManager$Stub.onTransact(ILocationManager.java:832)
Expected results
Ideally we should be getting periodic updates from the approximate location.
Actual results
The app crashes.
Code sample
Code sample
```dart if (await Geolocator.isLocationServiceEnabled()) { var permission = await Geolocator.checkPermission(); if (permission == LocationPermission.denied || permission == LocationPermission.unableToDetermine) { permission = await Geolocator.requestPermission(); } if (permission == LocationPermission.denied || permission == LocationPermission.deniedForever) { return; } final position = await Geolocator.getLastKnownPosition(); if (position != null) { //handle position } _subscription = Geolocator.getPositionStream().listen( (position) { //handle position update }, ); } else { //no location } ```Screenshots or video
Screenshots or video demonstration
[Upload media here]Version
12.0.0
Flutter Doctor output
Doctor output
```console [√] Flutter (Channel stable, 3.22.1, on Microsoft Windows [Version 10.0.22631.3593], locale en-US) [√] Windows Version (Installed version of Windows is version 10 or higher) [√] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [√] Chrome - develop for the web [√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.5.2) [√] Android Studio (version 2023.3) [√] VS Code (version 1.89.1) [√] Connected device (4 available) [√] Network resources ```