skip to Main Content

I am studying the examples in mapbox in android studio but when I run the code it shows
FAILURE: Build failed with an exception.

Execution failed for task ‘:app:checkDebugDuplicateClasses’.
A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
Duplicate class com.mapbox.android.telemetry.AlarmReceiver found in modules

This is my implementations in the gradle

implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.6.2'
implementation ('com.mapbox.mapboxsdk:mapbox-android-sdk:9.6.2'){
    exclude group: 'group_name', module: 'module_name'
}
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-locationlayer:0.11.0'
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-services:4.8.0'
implementation('com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.42.6') {
    exclude group: 'com.mapbox.mapboxsdk', module: 'mapbox-android-plugin-annotation-v8'
}

and this is the error that it shows

Execution failed for task ':app:checkDebugDuplicateClasses'.
A failure occurred while executing 
com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
Duplicate class com.mapbox.android.telemetry.AlarmReceiver found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.AlarmSchedulerFlusher found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.AppUserTurnstile found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.AppUserTurnstile$1 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.Attachment found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.Attachment$1 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.AttachmentListener found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.AttachmentMetadata found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.BuildConfig found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.CertificateBlacklist found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.CertificateBlacklist$1 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.CertificatePinnerFactory found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.CertificatePinnerFactory$1 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.ChinaCertificatePins found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.ChinaCertificatePins$1 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.ChinaCertificatePins$1$1 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.ChinaServerInformation found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.Clock found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.ComCertificatePins found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.ComCertificatePins$1 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.ComCertificatePins$1$1 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.ComServerInformation found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.ConcurrentQueue found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.ConfigurationChangeHandler found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.ConfigurationClient found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.ConfigurationClient$1 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.CrashEvent found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.Environment found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.EnvironmentChain found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.EnvironmentResolver found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.Event found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.Event$Type found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.EventsQueue found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.EventsQueue$1 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.FileAttachment found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.FileData found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.FullQueueCallback found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.GzipRequestInterceptor found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.GzipRequestInterceptor$1 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.LocationEvent found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.LocationEvent$1 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.Logger found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.MapboxTelemetry found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.MapboxTelemetry$1 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.MapboxTelemetry$2 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.MapboxTelemetry$3 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.MapboxTelemetry$4 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.MapboxTelemetry$5 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.MapboxTelemetry$6 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.MapboxTelemetry$7 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.MapboxTelemetry$ExecutorServiceFactory found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.MapboxTelemetry$ExecutorServiceFactory$1 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.MapboxTelemetryConstants found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.SchedulerCallback found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.SchedulerFlusher found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.SchedulerFlusherFactory found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.ServerInformation found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.ServiceTaskCallback found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.SessionInterval found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.StagingCertificatePins found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.StagingCertificatePins$1 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.StagingCertificatePins$1$1 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.StagingServerInformation found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.TelemetryCallback found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.TelemetryClient found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.TelemetryClient$1 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.TelemetryClientFactory found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.TelemetryClientFactory$1 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.TelemetryClientSettings found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.TelemetryClientSettings$1 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.TelemetryClientSettings$Builder found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.TelemetryEnabler found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.TelemetryEnabler$1 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.TelemetryEnabler$2 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.TelemetryEnabler$State found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.TelemetryListener found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.TelemetryResponse found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.TelemetryUtils found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.TelemetryUtils$1 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.VisionBuildEvent found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.VisionEvent found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.VisionEvent$1 found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)
 Duplicate class com.mapbox.android.telemetry.VisionEventFactory found in modules jetified-mapbox-android-telemetry-4.7.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry:4.7.0) and mapbox-android-telemetry-okhttp3-8.1.0-runtime (com.mapbox.mapboxsdk:mapbox-android-telemetry-okhttp3:8.1.0)...

I have already added android.enableJetifier=true in the gradle.properties but it still shows an error. Can anyone help me. I am currently stuck at the moment.

2

Answers


  1. If you check which modules are actually duplicated, you will see that it is mapbox-android-telemetry. Therefore, what you’re are looking for is:

    implementation ("com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.42.6", {
        exclude group: 'com.mapbox.mapboxsdk', module:'mapbox-android-telemetry'
    })
    

    Note that the latest version of com.mapbox.navigation:ui is 1.5.1 at the time of this post. Therefore I recommend using:

    implementation ("com.mapbox.navigation:ui:1.5.1", {
        exclude group: 'com.mapbox.mapboxsdk', module:'mapbox-android-telemetry'
    })
    

    (Also note that ‘group_name’ and ‘module_name’ are placeholders in your code snippet)

    Login or Signup to reply.
  2. Comment this line implementation:

    com.mapbox.mapboxsdk:mapbox-android-navigation:0.42.6 
    

    and sync your project.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search