mapbox-maps-flutter icon indicating copy to clipboard operation
mapbox-maps-flutter copied to clipboard

Conflict Between mapbox-maps-flutter Library and Mainstream Location Libraries (e.g., location, geolocator)

Open shihanjun19 opened this issue 1 year ago • 2 comments

Content: While testing with mapbox-maps-flutter/example/, I encountered conflicts between the mapbox-maps-flutter library and common location libraries. After integrating either location: ^5.0.3 or geolocator: ^10.1.0 into my project, I noticed that the animated route line page in the mapbox example failed to obtain correct location data during real device debugging.

Steps to Reproduce:

  1. Add either location: ^5.0.3 or geolocator: ^10.1.0 to the project's pubspec.yaml file.
  2. Run the project.
  3. Observe that mapbox is unable to acquire location data.

Error Log:

I/Mapbox  (18814): [maps-core]: Using OpenGL render backend
I/Mapbox  (18814): [threading]: MapboxRenderThr priority is now -10
I/Mapbox  (18814): [maps-android\Mbgl-RenderThread]: Native renderer created.
I/Mapbox  (18814): [maps-android\Mbgl-RenderThread]: onSurfaceCreated: Android surface was processed.
I/Mapbox  (18814): [threading]: Worker 1 priority is now 4
I/Mapbox  (18814): [maps-core]: {MapboxRenderThr}[General]: GPU Identifier: Mali-G76
I/Mapbox  (18814): [threading]: ResourceLoaderT priority is now 4
I/Mapbox  (18814): [threading]: TileStoreFileSo priority is now 4
E/flutter (18814): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
E/flutter (18814): #0      PuckPosition.getPuckPosition (package:mapbox_maps_example/utils.dart:92:42)
E/flutter (18814): <asynchronous suspension>
E/flutter (18814): #1      AnimatedRouteState.refreshTrackLocation.<anonymous closure> (package:mapbox_maps_example/animated_route.dart:130:26)
E/flutter (18814): <asynchronous suspension>

Device Information:

  • Phone: HUAWEI P30
  • OS: HarmonyOS 3.0.0

shihanjun19 avatar Nov 29 '23 01:11 shihanjun19