Closed moiatto closed 1 year ago
How can I force LocationEngineProvider to use Android GPS and Network Providers instead Google's Fused Location Providers ?
Short story:
The problem start from the last line:
MapboxNavigationOptions options = MapboxNavigationOptions.builder() .isDebugLoggingEnabled(true) .build(); navigation = new MapboxNavigation(requireContext(), options); navigation.addNavigationEventListener(this); navigation.addMilestoneEventListener(this); navigation.setLocationEngine(LocationEngineProvider.getBestLocationEngine(requireContext()));
I have this dependencies in my app
implementation 'com.google.android.gms:play-services-location:21.0.1' implementation 'com.github.maplibre:maplibre-navigation-android:84e9f77a55' implementation 'org.maplibre.gl:android-sdk:9.6.0'
The gms v21.0.1 is not compatible with maplibre-gl v9.6.0, throwing this error:
java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.location.FusedLocationProviderClient....
I have tried to update maplibre-gl to the last version v10.0.1, but there are 2 problems;
navigation.setLocationEngine
On run app I get errors about icons not found linked in the library file values.xml at pos: 9711:
values.xml
.... <style name="mapbox_LocationLayer"> <item name="mapbox_foregroundDrawable">@drawable/mapbox_user_icon</item> <item name="mapbox_backgroundDrawable">@drawable/mapbox_user_stroke_icon</item> <item name="mapbox_bearingDrawable">@drawable/mapbox_user_bearing_icon</item> <item name="mapbox_gpsDrawable">@drawable/mapbox_user_puck_icon</item> <item name="mapbox_foregroundDrawableStale">@drawable/mapbox_user_icon_stale</item> <item name="mapbox_backgroundDrawableStale">@drawable/mapbox_user_stroke_icon</item> <item name="mapbox_accuracyAlpha">0.15</item> <item name="mapbox_accuracyColor">@color/mapbox_location_layer_blue</item> ....
where can i find these icons?
So, the alternative is to use Android GPS and Network Providers instead of Google's Fused Location Providers.
This repo is now on v10.0.2, maybe you want to try again?
I will close this for now, as I haven't heard back. You can set the locationEngine when you init the MapboxNavigation class.
How can I force LocationEngineProvider to use Android GPS and Network Providers instead Google's Fused Location Providers ?
Short story:
The problem start from the last line:
I have this dependencies in my app
The gms v21.0.1 is not compatible with maplibre-gl v9.6.0, throwing this error:
I have tried to update maplibre-gl to the last version v10.0.1, but there are 2 problems;
navigation.setLocationEngine
On run app I get errors about icons not found linked in the library file
values.xml
at pos: 9711:where can i find these icons?
So, the alternative is to use Android GPS and Network Providers instead of Google's Fused Location Providers.