eopeter / flutter_mapbox_navigation

Turn By Turn Navigation for Your Flutter Application
Apache License 2.0
211 stars 175 forks source link

mapbox_gl incompatibility and error ^0.0.26 #273

Closed Diielle closed 12 months ago

Diielle commented 1 year ago

Hi,

I need to use flutter_mapbox_navigation together with mapgox_gl I am using mapbox_gl: ^0.16.0

Using version ^0.1.8 of flutter_mapbox_navigation the app does not even start and appear in the console incompatibility errors for pod 'MapboxNavigation'.

whereas if I use 0.0.26 lines of code

distanceRemaining = await directions.distanceRemaining;
durationRemaining = await directions.durationRemaining

cause the error: type "Null" is not a subtype is not a subtype of type "FutureOr<double>".

What can I do to solve it? Thank you

alexeileyvamora commented 1 year ago

I suggest you to use the official mapbox package mapbox_maps_flutter: ^0.4.4.

From my experience mapbox_maps_flutter has more options than mapbox_gl, moreover mapbox_maps_flutter is officially developed by mapbox and allows the use of the latest Maps SDK (v10.13.0).

ah mapbox_maps_flutter: ^0.4.4. and flutter_mapbox_navigation: ^0.1.8 compatibility using flutter 3.10.0

Diielle commented 1 year ago

I am still using mapbox_gl because I need the offline...

thanks

ARA-ZET commented 1 year ago

just below the buildTypes in your android/app/build.gradle file add this code it worked for me configurations { all { exclude group: 'com.mapbox.mapboxsdk', module: 'mapbox-android-core' } }

maxchris100 commented 1 year ago

just below the buildTypes in your android/app/build.gradle file add this code it worked for me configurations { all { exclude group: 'com.mapbox.mapboxsdk', module: 'mapbox-android-core' } }

still crash error E/AndroidRuntime( 372): FATAL EXCEPTION: main E/AndroidRuntime( 372): Process: com.xx.xxx, PID: 372 E/AndroidRuntime( 372): java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.location.SettingsClient, but class was expected (declaration of 'com.google.android.gms.location.SettingsClient' appears in /data/app/~~KCJs9AWB0l3Et_5NZQ9Ixw==/com.doa.rtrwclientt-VY_KthvwY21cXpQxffqq9A==/base.apk!classes6.dex) E/AndroidRuntime( 372): at com.lyokone.location.FlutterLocation.startRequestingLocation(FlutterLocation.java:422)

using mapbox_gl and mapboxmap navigation

eopeter commented 1 year ago

Stale issue message