mapbox / mapbox-maps-android

Interactive, thoroughly customizable maps in native Android powered by vector tiles and OpenGL.
https://www.mapbox.com/mobile-maps-sdk
Other
478 stars 134 forks source link

Duplicate Class found when using the `-ndk` version in order to support 16KB versions and Android 15 #2506

Closed PavlosTze closed 2 weeks ago

PavlosTze commented 2 weeks ago

Environment

Observed behavior and steps to reproduce

I am using the following libraries: implementation "com.mapbox.maps:android-ndk27:11.7.1" implementation "com.mapbox.mapboxsdk:mapbox-sdk-services:7.3.1" implementation "com.mapbox.search:mapbox-search-android:2.5.1"

And the following errors showed in the console (I truncated them, the full log can be found in the attached file):

Duplicate class com.mapbox.android.core.permissions.PermissionsListener found in modules common-24.7.0.aar -> common-24.7.0-runtime (com.mapbox.common:common:24.7.0) and common-ndk27-24.7.1.aar -> common-ndk27-24.7.1-runtime (com.mapbox.common:common-ndk27:24.7.1)
Duplicate class com.mapbox.android.core.permissions.PermissionsManager found in modules common-24.7.0.aar -> common-24.7.0-runtime (com.mapbox.common:common:24.7.0) and common-ndk27-24.7.1.aar -> common-ndk27-24.7.1-runtime (com.mapbox.common:common-ndk27:24.7.1)
Duplicate class com.mapbox.android.core.permissions.PermissionsManager$AccuracyAuthorization found in modules common-24.7.0.aar -> common-24.7.0-runtime (com.mapbox.common:common:24.7.0) and common-ndk27-24.7.1.aar -> common-ndk27-24.7.1-runtime (com.mapbox.common:common-ndk27:24.7.1)
Duplicate class com.mapbox.android.core.permissions.PermissionsManager$Companion found in modules common-24.7.0.aar -> common-24.7.0-runtime (com.mapbox.common:common:24.7.0) and common-ndk27-24.7.1.aar -> common-ndk27-24.7.1-runtime (com.mapbox.common:common-ndk27:24.7.1)
Duplicate class com.mapbox.bindgen.ArrayUtils found in modules common-24.7.0.aar -> common-24.7.0-runtime (com.mapbox.common:common:24.7.0) and common-ndk27-24.7.1.aar -> common-ndk27-24.7.1-runtime (com.mapbox.common:common-ndk27:24.7.1)
Duplicate class com.mapbox.bindgen.Cleaner found in modules common-24.7.0.aar -> common-24.7.0-runtime (com.mapbox.common:common:24.7.0) and common-ndk27-24.7.1.aar -> common-ndk27-24.7.1-runtime (com.mapbox.common:common-ndk27:24.7.1)
...
...
...
...
Duplicate class com.mapbox.common.movement.ProxyGoogleActivityRecognitionClient$Companion$available$2 found in modules common-24.7.0.aar -> common-24.7.0-runtime (com.mapbox.common:common:24.7.0) and common-ndk27-24.7.1.aar -> common-ndk27-24.7.1-runtime (com.mapbox.common:common-ndk27:24.7.1)
Duplicate class com.mapbox.common.movement.StubActivityRecognition found in modules common-24.7.0.aar -> common-24.7.0-runtime (com.mapbox.common:common:24.7.0) and common-ndk27-24.7.1.aar -> common-ndk27-24.7.1-runtime (com.mapbox.common:common-ndk27:24.7.1)

Expected behavior

I would expect no error so we can support Android 15 and 16KB versions.

Full error log

error.txt

kiryldz commented 2 weeks ago

If any Mapbox component uses -ndk27 suffix - then all the components should use it as well. com.mapbox.search:mapbox-search-android does not provide NDK 27 builds now but will provide them shortly (same for Nav SDK). Please keep an eye on release notes for Search and Nav. Also public documentation will be updated when the whole stack will support both default NDK and NDK 27.