我正在研究 android studio 中的 mapbox 中的示例,但是当我运行代码时,它显示 FAILURE: Build failed with an exception。
任务“:app:checkDebugDuplicateClasses”执行失败。执行 com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable 模块中发现重复类 com.mapbox.android.telemetry.AlarmReceiver 时发生故障
这是我在 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'
}
Run Code Online (Sandbox Code Playgroud)
这是它显示的错误
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 …Run Code Online (Sandbox Code Playgroud)