Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate class found #2181

Closed
anonym24 opened this issue Sep 24, 2023 · 10 comments
Closed

Duplicate class found #2181

anonym24 opened this issue Sep 24, 2023 · 10 comments
Labels
bug 🪲 Something isn't working

Comments

@anonym24
Copy link

anonym24 commented Sep 24, 2023

implementation(libs.mapbox)
implementation(libs.mapbox.compose)
implementation(libs.mapbox.place.autocomplete)
implementation(libs.mapbox.search.android)
implementation(libs.mapbox.android.core)

libs catalog:

mapbox = "11.0.0-beta.1"
mapboxAndroidCore = "3.1.0"
mapboxCompose = "0.1.0"
mapboxSearchAndroid = "1.0.0-rc.6"
mapboxPlaceAutocomplete = "1.0.0-rc.6"

mapbox = { group = "com.mapbox.maps", name = "android", version.ref = "mapbox" }
mapbox-android-core = { module = "com.mapbox.mapboxsdk:mapbox-android-core", version.ref = "mapboxAndroidCore" }
mapbox-compose = { group = "com.mapbox.extension", name = "maps-compose", version.ref = "mapboxCompose" }
mapbox-place-autocomplete = { module = "com.mapbox.search:place-autocomplete", version.ref = "mapboxPlaceAutocomplete" }
mapbox-search-android = { module = "com.mapbox.search:mapbox-search-android", version.ref = "mapboxSearchAndroid" }

Errors during building:

Duplicate class com.mapbox.android.core.permissions.PermissionsListener found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and mapbox-android-core-3.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-core:3.1.0)
Duplicate class com.mapbox.android.core.permissions.PermissionsManager found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and mapbox-android-core-3.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-core:3.1.0)
Duplicate class com.mapbox.common.module.okhttp.CallbackWrapper found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.CallbackWrapper$RequestCallback found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.CertificatePinnerFactory found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.HttpCallback found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.IdGenerator found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.LazyClient found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.MapboxOkHttpService found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.MapboxOkHttpService$1 found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.MapboxOkHttpService$HttpServiceOfflineSwitchObserver found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.NetworkUsageListener found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.NetworkUsageListener$1 found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.NetworkUsageListener$DummyEventListener found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.NetworkUsageListener$NetworkUsageMetricCallback found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.module.Mapbox_HttpClientModuleConfiguration found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
@anonym24 anonym24 added the bug 🪲 Something isn't working label Sep 24, 2023
@anonym24
Copy link
Author

?

@anonym24
Copy link
Author

anonym24 commented Sep 25, 2023

Tried to updated the following lib mapboxAndroidCore = "5.0.0", same:

Duplicate class com.mapbox.android.core.permissions.PermissionsListener found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and mapbox-android-core-5.0.0-runtime (com.mapbox.mapboxsdk:mapbox-android-core:5.0.0)
Duplicate class com.mapbox.android.core.permissions.PermissionsManager found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and mapbox-android-core-5.0.0-runtime (com.mapbox.mapboxsdk:mapbox-android-core:5.0.0)
Duplicate class com.mapbox.android.core.permissions.PermissionsManager$AccuracyAuthorization found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and mapbox-android-core-5.0.0-runtime (com.mapbox.mapboxsdk:mapbox-android-core:5.0.0)
Duplicate class com.mapbox.common.module.okhttp.CallbackWrapper found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.CallbackWrapper$RequestCallback found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.CertificatePinnerFactory found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.HttpCallback found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.IdGenerator found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.LazyClient found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.MapboxOkHttpService found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.MapboxOkHttpService$1 found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.MapboxOkHttpService$HttpServiceOfflineSwitchObserver found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.NetworkUsageListener found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.NetworkUsageListener$1 found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.NetworkUsageListener$DummyEventListener found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.common.module.okhttp.NetworkUsageListener$NetworkUsageMetricCallback found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)
Duplicate class com.mapbox.module.Mapbox_HttpClientModuleConfiguration found in modules common-24.0.0-beta.2-runtime (com.mapbox.common:common:24.0.0-beta.2) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)

@yunikkk
Copy link
Contributor

yunikkk commented Oct 4, 2023

@anonym24 why do you need com.mapbox.mapboxsdk:mapbox-android-core dependency?

Additionally - maps v11 depends on different mapbox common version, Maps 11.0.0-beta.1 is not compatible with search 1.0.0-rc.6. This is described in the search documentation for instance - https://docs.mapbox.com/android/search/guides/get-started/#add-the-dependency. Currently you'll have to use Maps v10 if you need search also.

@Debanshu777
Copy link

Debanshu777 commented Oct 16, 2023

@yunikkk Thanks for the reasoning. But is there any workaround for this issue for now?

@yunikkk
Copy link
Contributor

yunikkk commented Oct 16, 2023

@Debanshu777 use v10 maps if other Mapbox SDKs are in use

@Debanshu777
Copy link

@yunikkk I was actually looking the use of Jetpack Compose Map Extension, which is using this specific version 11.0.0-beta.1 stated here. This is giving Duplicate class exception for modules com.mapbox.common is there any fixes coming up or need to wait for the later stable versions?

@yunikkk
Copy link
Contributor

yunikkk commented Oct 17, 2023

@Debanshu777 could you please submit the new issue describing your setup? This one is caused by different incompatible versions of our libs, yours is different it seems.

@FraRo96
Copy link

FraRo96 commented Oct 17, 2023

@yunikkk and @Debanshu777 similar issue. I've opened a bug report.

@baleboy
Copy link
Contributor

baleboy commented Nov 27, 2023

As explained, this particular issue is caused by incompatible mapbox SDKs. For the time being, Search SDK is only compatible with v10.

@baleboy baleboy closed this as completed Nov 27, 2023
@macro39
Copy link

macro39 commented Dec 26, 2023

Hello, do you have any update of Mapbox SDK v11 compatibility with Search SDK? I am still getting duplicate class exception. I am trying to use search with mapbox compose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants