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

Failed to build when using 11.0.0 and MapBox Search 1.0.0-rc7 #171

Closed
PavlosTze opened this issue Dec 7, 2023 · 11 comments
Closed

Failed to build when using 11.0.0 and MapBox Search 1.0.0-rc7 #171

PavlosTze opened this issue Dec 7, 2023 · 11 comments

Comments

@PavlosTze
Copy link

Environment

  • Android OS version:
  • Devices affected: -
  • Maps SDK Version: 11.0.0
  • MapBox Search Version: 1.0.0-rc7

Observed behavior and steps to reproduce

I am importing both libraries:

    implementation("com.mapbox.maps:android:11.0.0")
    implementation("com.mapbox.search:mapbox-search-android:1.0.0-rc.7")

And I get the following error:

  • What went wrong:
    Execution failed for task ':app:checkRemoteProdDebugDuplicateClasses'.

A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
Duplicate class com.mapbox.common.module.okhttp.CallbackWrapper found in modules common-24.0.0-runtime (com.mapbox.common:common:24.0.0) 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-runtime (com.mapbox.common:common:24.0.0) 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-runtime (com.mapbox.common:common:24.0.0) 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-runtime (com.mapbox.common:common:24.0.0) 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-runtime (com.mapbox.common:common:24.0.0) 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-runtime (com.mapbox.common:common:24.0.0) 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-runtime (com.mapbox.common:common:24.0.0) 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-runtime (com.mapbox.common:common:24.0.0) 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-runtime (com.mapbox.common:common:24.0.0) 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-runtime (com.mapbox.common:common:24.0.0) 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-runtime (com.mapbox.common:common:24.0.0) 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-runtime (com.mapbox.common:common:24.0.0) 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-runtime (com.mapbox.common:common:24.0.0) and okhttp-23.6.0-runtime (com.mapbox.common:okhttp:23.6.0)

When commenting out the search library it builds successfully with no error.

Expected behavior

I would expect it to build with no issues.

Notes / preliminary analysis

Additional links and references

@DzmitryFomchyn DzmitryFomchyn transferred this issue from mapbox/mapbox-maps-android Dec 7, 2023
@ghost ghost self-assigned this Dec 7, 2023
@TiagoLira
Copy link

I've had this issue in the past, whenever the two libraries use different versions of the com.mapbox.common library.
Is there a gradle workaround that is safe, or do we need to wait for a search library update?

Right now this is forcing me to use a maps version that is 6 months old.

@PavlosTze
Copy link
Author

@eugenes78 Do we have any news on that?

@PavlosTze
Copy link
Author

This is still an issue on Mapbox 11.1.0, we cannot upgrade Mapbox library. Any news on that @eugenes78 @DzmitryFomchyn ?

@jvanderwee
Copy link

Ditto. We'd love to start using Maps v11!

@narko
Copy link

narko commented Feb 5, 2024

For the records, this issue also affects Mapbox Navigation 2.18.0

@DzmitryFomchyn
Copy link
Contributor

This is still an issue on Mapbox 11.1.0, we cannot upgrade Mapbox library. Any news on that @eugenes78 @DzmitryFomchyn ?

Hello everyone,
I am no longer in charge of the Search SDK. Therefore, I won't be able to assist with your requests regarding it.

@mapbox-danny @eugenes78 could you please help with that?

@narko
Copy link

narko commented Feb 22, 2024

I spotted the following on the navigation lib: https://docs.mapbox.com/android/navigation/build-with-coreframework/migration-from-v2#maps-sdk

Are we expecting the same change for the search lib in 2.0.0-alpha?

@narko
Copy link

narko commented Feb 28, 2024

@eugenes78 any chance you could release a public alpha of this to facilitate the migration of the APIs already?

@ghost
Copy link

ghost commented Apr 10, 2024

2.0.0-beta.4 works with Maps v11. Please let me know if you hit any issues.

@ghost ghost closed this as completed Apr 10, 2024
@dudeuter
Copy link

dudeuter commented May 1, 2024

For anyone looking at this in the future...

Maps, Navigation, and Search rely on a common shared object. Your best bet is to find a version of the SDKs that you use that have a shared common version; this is done for you in the case that you're importing your Maps SDK as a dependency of the Navigation or Search SDKs.

If you're explicitly overriding the Maps SDK; or trying to use Search and Navigation together you'll need to watch out for this. We usually publish the Common SDK version in the release notes, example

But you can also find them in the repo's source code:

common_sdk_version = '24.4.0-beta.2'

v10 Maps SDK

v11 Maps SDK

v2 Navigation SDK

You'll get the best experience using stable versions that are released with the same Common version; as they're more or less built to be used together; but they should be ABI compatible through patch versions; just make sure you're picking the most recent version to make sure you're getting fixes from the patch.

@jvanderwee
Copy link

@dudeuter a Mapbox bill of materials would be nice to ensure compatible versions are used 🙏

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants