eopeter / flutter_mapbox_navigation

Turn By Turn Navigation for Your Flutter Application
Apache License 2.0
208 stars 162 forks source link

Crashes when using besides: mapbox_maps_flutter: ^1.0.0 #347

Open YoavSl opened 4 months ago

YoavSl commented 4 months ago

When trying to use this library in addition to "mapbox_maps_flutter: ^1.0.0" the build would fail with a lot of "Execution failed for task ':app:checkDebugDuplicateClasses'"" errors as these 2 libraries share some basic classes of MapBox and the classes don't match. If I'm reverting to the previous version of the official MapBox library: "mapbox_maps_flutter: ^0.5.1" everything is working fine. I have to use these two side by side as each one of them is giving me some features that I need.

eopeter commented 4 months ago

Can you provide more details of the error log and stack trace?

YoavSl commented 4 months ago

Sure and thanks for your help. In version 1.0.0 of 'mapbox_maps_flutter' they updated some of their modules, and you are still using an older versions. Because both plugins share some of these libraries there are conflicts (because of the different versions being used in each one). I'm getting a lot of 'Duplicate classes' errors: Execution failed for task ':app:checkDebugDuplicateClasses'.

A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable Duplicate class com.mapbox.common.module.okhttp.CallbackWrapper found in modules jetified-common-24.2.0-runtime (com.mapbox.common:common:24.2.0) and jetified-okhttp-23.8.0-runtime (com.mapbox.common:okhttp:23.8.0) Duplicate class com.mapbox.common.module.okhttp.CallbackWrapper$RequestCallback found in modules jetified-common-24.2.0-runtime (com.mapbox.common:common:24.2.0) and jetified-okhttp-23.8.0-runtime (com.mapbox.common:okhttp:23.8.0) Duplicate class com.mapbox.common.module.okhttp.HttpCallback found in modules jetified-common-24.2.0-runtime (com.mapbox.common:common:24.2.0) and jetified-okhttp-23.8.0-runtime (com.mapbox.common:okhttp:23.8.0) Duplicate class com.mapbox.common.module.okhttp.IdGenerator found in modules jetified-common-24.2.0-runtime (com.mapbox.common:common:24.2.0) and jetified-okhttp-23.8.0-runtime (com.mapbox.common:okhttp:23.8.0) Duplicate class com.mapbox.common.module.okhttp.LazyClient found in modules jetified-common-24.2.0-runtime (com.mapbox.common:common:24.2.0) and jetified-okhttp-23.8.0-runtime (com.mapbox.common:okhttp:23.8.0) Duplicate class com.mapbox.common.module.okhttp.MapboxOkHttpService found in modules jetified-common-24.2.0-runtime (com.mapbox.common:common:24.2.0) and jetified-okhttp-23.8.0-runtime (com.mapbox.common:okhttp:23.8.0) Duplicate class com.mapbox.common.module.okhttp.MapboxOkHttpService$1 found in modules jetified-common-24.2.0-runtime (com.mapbox.common:common:24.2.0) and jetified-okhttp-23.8.0-runtime (com.mapbox.common:okhttp:23.8.0) Duplicate class com.mapbox.common.module.okhttp.MapboxOkHttpService$HttpServiceGetLifecycleStateCallback found in modules jetified-common-24.2.0-runtime (com.mapbox.common:common:24.2.0) and jetified-okhttp-23.8.0-runtime (com.mapbox.common:okhttp:23.8.0) Duplicate class com.mapbox.common.module.okhttp.MapboxOkHttpService$HttpServiceLifecycleObserver found in modules jetified-common-24.2.0-runtime (com.mapbox.common:common:24.2.0) and jetified-okhttp-23.8.0-runtime (com.mapbox.common:okhttp:23.8.0) Duplicate class com.mapbox.common.module.okhttp.MapboxOkHttpService$HttpServiceOfflineSwitchObserver found in modules jetified-common-24.2.0-runtime (com.mapbox.common:common:24.2.0) and jetified-okhttp-23.8.0-runtime (com.mapbox.common:okhttp:23.8.0) Duplicate class com.mapbox.common.module.okhttp.MapboxOkHttpService$QueuedRequest found in modules jetified-common-24.2.0-runtime (com.mapbox.common:common:24.2.0) and jetified-okhttp-23.8.0-runtime (com.mapbox.common:okhttp:23.8.0) Duplicate class com.mapbox.common.module.okhttp.NetworkUsageListener found in modules jetified-common-24.2.0-runtime (com.mapbox.common:common:24.2.0) and jetified-okhttp-23.8.0-runtime (com.mapbox.common:okhttp:23.8.0) Duplicate class com.mapbox.common.module.okhttp.NetworkUsageListener$1 found in modules jetified-common-24.2.0-runtime (com.mapbox.common:common:24.2.0) and jetified-okhttp-23.8.0-runtime (com.mapbox.common:okhttp:23.8.0) Duplicate class com.mapbox.common.module.okhttp.NetworkUsageListener$DummyEventListener found in modules jetified-common-24.2.0-runtime (com.mapbox.common:common:24.2.0) and jetified-okhttp-23.8.0-runtime (com.mapbox.common:okhttp:23.8.0) Duplicate class com.mapbox.common.module.okhttp.NetworkUsageListener$NetworkUsageMetricCallback found in modules jetified-common-24.2.0-runtime (com.mapbox.common:common:24.2.0) and jetified-okhttp-23.8.0-runtime (com.mapbox.common:okhttp:23.8.0) Duplicate class com.mapbox.module.Mapbox_HttpClientModuleConfiguration found in modules jetified-common-24.2.0-runtime (com.mapbox.common:common:24.2.0) and jetified-okhttp-23.8.0-runtime (com.mapbox.common:okhttp:23.8.0)

anjana1904 commented 3 months ago

I'm facing the same issue. Does anyone have a solution for it? mapbox_maps_flutter: ^1.0.0 flutter_mapbox_navigation: ^0.2.2

nikhilsingh834783 commented 3 months ago

Is there any update on this i am also facing same issue @YoavSl have you found any alternative solution? please help thanks.

YoavSl commented 2 months ago

Is there any update on this i am also facing same issue @YoavSl have you found any alternative solution? please help thanks.

Sorry, couldn't find any solution. Reverted to the previous working version (mapbox_maps_flutter 0.5.1).

eladkariti commented 3 weeks ago

Same issue :-(