flutter-mapbox-gl / maps

A Mapbox GL flutter package for creating custom maps
Other
1.03k stars 498 forks source link

Execution failed for task ':app:checkDebugDuplicateClasses'. #1382

Closed sKY02644 closed 5 months ago

sKY02644 commented 9 months ago
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class com.mapbox.android.core.location.LocationEngine found in modules jetified-common-23.8.0-runtime (com.mapbox.common:common:23.8.0) and jetified-mapbox-android-core-5.0.0-runtime (com.mapbox.mapboxsdk:mapbox-android-core:5.0.0)
     Duplicate class com.mapbox.android.core.location.LocationEngineCallback found in modules jetified-common-23.8.0-runtime (com.mapbox.common:common:23.8.0) and jetified-mapbox-android-core-5.0.0-runtime (com.mapbox.mapboxsdk:mapbox-android-core:5.0.0)
     Duplicate class com.mapbox.android.core.location.LocationEngineProvider found in modules jetified-common-23.8.0-runtime (com.mapbox.common:common:23.8.0) and jetified-mapbox-android-core-5.0.0-runtime (com.mapbox.mapboxsdk:mapbox-android-core:5.0.0)
     Duplicate class com.mapbox.android.core.location.LocationEngineRequest found in modules jetified-common-23.8.0-runtime (com.mapbox.common:common:23.8.0) and jetified-mapbox-android-core-5.0.0-runtime (com.mapbox.mapboxsdk:mapbox-android-core:5.0.0)
     Duplicate class com.mapbox.android.core.location.LocationEngineRequest$1 found in modules jetified-common-23.8.0-runtime (com.mapbox.common:common:23.8.0) and jetified-mapbox-android-core-5.0.0-runtime (com.mapbox.mapboxsdk:mapbox-android-core:5.0.0)
     Duplicate class com.mapbox.android.core.location.LocationEngineRequest$Builder found in modules jetified-common-23.8.0-runtime (com.mapbox.common:common:23.8.0) and jetified-mapbox-android-core-5.0.0-runtime (com.mapbox.mapboxsdk:mapbox-android-core:5.0.0)
     Duplicate class com.mapbox.android.core.location.LocationEngineResult found in modules jetified-common-23.8.0-runtime (com.mapbox.common:common:23.8.0) and jetified-mapbox-android-core-5.0.0-runtime (com.mapbox.mapboxsdk:mapbox-android-core:5.0.0)
     Duplicate class com.mapbox.android.core.permissions.PermissionsListener found in modules jetified-common-23.8.0-runtime (com.mapbox.common:common:23.8.0) and jetified-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 jetified-common-23.8.0-runtime (com.mapbox.common:common:23.8.0) and jetified-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 jetified-common-23.8.0-runtime (com.mapbox.common:common:23.8.0) and jetified-mapbox-android-core-5.0.0-runtime (com.mapbox.mapboxsdk:mapbox-android-core:5.0.0)
       mapbox_gl:
            git:
              url: https://github.com/flutter-mapbox-gl/maps.git
              ref: master
       flutter_mapbox_navigation: ^0.2.0

i am getting the above error when i add the current version of the flutter_mapbox_navigation with the current version of the mapbox_gl

only flutter_mapbox_navigation: ^0.0.26 seems to work with the current version of mapbox_gl

please help ASAP

please we are too deep to start all over any one here to assist

@tobrun @andrea689 @felix-ht @felix-mittermeier @TimothySealy

devkirch commented 8 months ago

Did you find a solution?

felix-mittermeier commented 8 months ago

The issue seems to be that both packages import (parts of) the same library because both ones are using MapBox internally and this throws the "Duplicate class" error.

For example in Flutter there is a syntax to exclude specific classes when importing something, like here: import 'package:flutter/material.dart' hide ElevatedButton; This prevents the import of ElevatedButton while still being able to use the rest of the material file normally.

I think there is something similar for Gradle to prevent certain classes (LocationEngine, LocationEngineCallback etc. - see your error message) from being imported. I remember there is an exclude keyword but you have to look up the specific syntax again. Hope this helps at least a bit to get into the right direction :-)

mfagri commented 8 months ago

Did you find a solution?

dhaq commented 8 months ago

Did you find a solution? @sKY02644

mfagri commented 8 months ago

Did you find a solution? @sKY02644

if you using flutter_mapbox_navigation and mapbox_gl at the same time for example ,you should remove one of them, that what i did to fix the problem .

sKY02644 commented 8 months ago

Did you find a solution? @sKY02644

if you using flutter_mapbox_navigation and mapbox_gl at the same time for example ,you should remove one of them, that what i did to fix the problem .

and what if you need both?

mfagri commented 8 months ago

Did you find a solution? @sKY02644

if you using flutter_mapbox_navigation and mapbox_gl at the same time for example ,you should remove one of them, that what i did to fix the problem .

and what if you need both?

in my situation i found what i need in mapbox_navigation ,and is better more then mapbox_gl

sKY02644 commented 8 months ago

Did you find a solution? @sKY02644

if you using flutter_mapbox_navigation and mapbox_gl at the same time for example ,you should remove one of them, that what i did to fix the problem .

and what if you need both?

in my situation i found what i need in mapbox_navigation ,and is better more then mapbox_gl

okay🙏🙏

stale[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

abdoul-kader1 commented 5 months ago

hello @sKY02644 ,with mapbox_navigation you can just display a map without doing voice assistance?

sKY02644 commented 5 months ago

hello @sKY02644 ,with mapbox_navigation you can just display a map without doing voice assistance?

i plan to use flutter_mapbox_navigation.

did not get to use mapbox_navigation