flutter_mapbox_navigation icon indicating copy to clipboard operation
flutter_mapbox_navigation copied to clipboard

Crashes when using besides: mapbox_maps_flutter: ^1.0.0

Open YoavSl opened this issue 1 year ago • 8 comments
trafficstars

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.

YoavSl avatar Mar 13 '24 12:03 YoavSl

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

eopeter avatar Mar 15 '24 11:03 eopeter

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)

YoavSl avatar Mar 17 '24 08:03 YoavSl

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

anjana1904 avatar Apr 10 '24 16:04 anjana1904

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

nikhilsingh834783 avatar Apr 18 '24 13:04 nikhilsingh834783

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).

YoavSl avatar Apr 29 '24 17:04 YoavSl

Same issue :-(

eladkariti avatar Jun 25 '24 11:06 eladkariti

Same issue

sumitdev786 avatar Jan 03 '25 08:01 sumitdev786

flutter_mapbox_navigation: 0.2.2 mapbox_maps_flutter: 0.4.4

antonzk avatar Apr 15 '25 23:04 antonzk