Skip to content
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

Granting only coarse location causes crash #122

Closed
Finni123 opened this issue Jun 22, 2024 · 5 comments
Closed

Granting only coarse location causes crash #122

Finni123 opened this issue Jun 22, 2024 · 5 comments
Labels

Comments

@Finni123
Copy link

Describe the bug
When I request location permission and only coarse location is granted, the app crashes. Nothing in my app uses location except for the location marker plugin, so it seems to be the cause.

To Reproduce
Steps to reproduce the behavior:

  1. Create FlutterMap with a CurrentLocationLayer child
  2. Request Location permission (on Android)
  3. Grant Approximate / coarse location only
  4. App crashes

Expected behavior
The map and this plugin should still work but show location with low precision, or no location.

Environment

  • Built on Windows 10 for Android 14
  • Flutter v3.22.1
  • flutter_map: ^7.0.1
  • flutter_map_location_marker: ^9.0.0
  • Overridden dependency because of this:
dependency_overrides:
 flutter_compass:
   git: https://github.com/helpisdev/flutter_compass.git

Error

E/AndroidRuntime(27264): FATAL EXCEPTION: main
E/AndroidRuntime(27264): Process: com.xyz.abc, PID: 27264
E/AndroidRuntime(27264): java.lang.SecurityException: Neither user 10575 nor current process has android.permission.ACCESS_FINE_LOCATION.
E/AndroidRuntime(27264): 	at android.os.Parcel.createExceptionOrNull(Parcel.java:3182)
E/AndroidRuntime(27264): 	at android.os.Parcel.createException(Parcel.java:3166)
E/AndroidRuntime(27264): 	at android.os.Parcel.readException(Parcel.java:3149)
E/AndroidRuntime(27264): 	at android.os.Parcel.readException(Parcel.java:3091)
E/AndroidRuntime(27264): 	at android.location.ILocationManager$Stub$Proxy.registerGnssNmeaCallback(ILocationManager.java:1622)
E/AndroidRuntime(27264): 	at android.location.LocationManager$GnssNmeaTransportManager.registerTransport(LocationManager.java:3109)
E/AndroidRuntime(27264): 	at android.location.LocationManager$GnssNmeaTransportManager.registerTransport(LocationManager.java:3099)
E/AndroidRuntime(27264): 	at com.android.internal.listeners.ListenerTransportManager.addListener(ListenerTransportManager.java:70)
E/AndroidRuntime(27264): 	at android.location.LocationManager.addNmeaListener(LocationManager.java:2611)
E/AndroidRuntime(27264): 	at android.location.LocationManager.addNmeaListener(LocationManager.java:2592)
E/AndroidRuntime(27264): 	at com.baseflow.geolocator.location.NmeaClient.start(NmeaClient.java:76)
E/AndroidRuntime(27264): 	at com.baseflow.geolocator.location.FusedLocationClient.requestPositionUpdates(FusedLocationClient.java:157)
E/AndroidRuntime(27264): 	at com.baseflow.geolocator.location.FusedLocationClient.lambda$startPositionUpdates$2$com-baseflow-geolocator-location-FusedLocationClient(FusedLocationClient.java:240)
E/AndroidRuntime(27264): 	at com.baseflow.geolocator.location.FusedLocationClient$$ExternalSyntheticLambda1.onSuccess(D8$$SyntheticClass:0)
E/AndroidRuntime(27264): 	at com.google.android.gms.tasks.zzm.run(com.google.android.gms:play-services-tasks@@18.1.0:1)
E/AndroidRuntime(27264): 	at android.os.Handler.handleCallback(Handler.java:959)
E/AndroidRuntime(27264): 	at android.os.Handler.dispatchMessage(Handler.java:100)
E/AndroidRuntime(27264): 	at android.os.Looper.loopOnce(Looper.java:232)
E/AndroidRuntime(27264): 	at android.os.Looper.loop(Looper.java:317)
E/AndroidRuntime(27264): 	at android.app.ActivityThread.main(ActivityThread.java:8501)
E/AndroidRuntime(27264): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(27264): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
E/AndroidRuntime(27264): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
E/AndroidRuntime(27264): Caused by: android.os.RemoteException: Remote stack trace:
E/AndroidRuntime(27264): 	at android.app.ContextImpl.enforce(ContextImpl.java:2333)
E/AndroidRuntime(27264): 	at android.app.ContextImpl.enforceCallingOrSelfPermission(ContextImpl.java:2361)
E/AndroidRuntime(27264): 	at com.android.server.location.gnss.GnssManagerService.registerGnssNmeaCallback(GnssManagerService.java:191)
E/AndroidRuntime(27264): 	at com.android.server.location.LocationManagerService.registerGnssNmeaCallback(LocationManagerService.java:1087)
E/AndroidRuntime(27264): 	at android.location.ILocationManager$Stub.onTransact(ILocationManager.java:806)

Possible solution
The error I get looks very similar to the error in this discussion, so I think maybe the solution from that thread should be applied to this plugin.

@tlserver
Copy link
Owner

tlserver commented Jul 1, 2024

Wondering this is an issue in geolocator or not. Since the call stack show that it is from com.baseflow.geolocator.location.NmeaClient.start(NmeaClient.java:76).

Copy link

github-actions bot commented Aug 1, 2024

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Aug 1, 2024
@tlserver tlserver removed the Stale label Aug 9, 2024
@tlserver
Copy link
Owner

tlserver commented Aug 25, 2024

Sorry, I cannot repoduce this issue. Does your problem still exist in current version?

Copy link

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Sep 25, 2024
Copy link

github-actions bot commented Oct 3, 2024

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants