mapbox / mapbox/mapbox-maps-flutter

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

Open
#310 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Dart
Stars
380
Forks
204
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in mapbox-maps-flutter/example/ with location: ^5.0.3 or geolocator: ^10.1.0 in pubspec.yaml. Start at PuckPosition.getPuckPosition in utils.dart:92 and AnimatedRouteState.refreshTrackLocation in animated_route.dart:130, then determine why location data becomes null. Done means the animated route example obtains correct location data during real-device debugging with either library present.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.