mapbox / mapbox-search-android

Android SDK for Mapbox Search including preconfigured UI
https://docs.mapbox.com/android/search/guides/
Other
33 stars 7 forks source link

Mapbox Search w/ Mapbox v9 #93

Closed cchierici closed 1 year ago

cchierici commented 1 year ago

Environment

Code examples

Observed behavior and steps

Observed a crash on App Start with the search core library only imported in buidl.gradle but without using any of it's functions or API.

java.lang.RuntimeException: Unable to get provider androidx.startup.InitializationProvider: androidx.startup.StartupException: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN6mapbox6common13EventsServiceC1EONS0_20EventsServiceOptionsE" referenced by "/data/app/~~SJ1CEMouzZWsBNbKOrhYSg==/de.xxx.yyy.dev-xG9CxLRFRi1L74mF_Fbw8w==/base.apk!/lib/arm64-v8a/libmapbox-maps.so"...

I tried before with 1.0.0-beta.38 which resulted in build issues due to a duplicated class MapboxCommonLogger.

So I assume that the search library only works with Mapbox v10. If there is a way to make it work with v9 please let me know, since i need the search feature very soon and a migration to v10 would take much more effort.

At least it would be nice to add a note on the search documentation page that v10 is required in case.

Thanks in advance

kalbaxa commented 1 year ago

Hi Claus, thanks for reaching out!

We highly encourage you to update from the Legacy Maps SDK to the high-performant v10, and I totally understand it's a migration effort, but the Migration guide should help.

Other than that we are keeping consistency for our SDK to work with the most recent version of Search, Maps and Navigation SDKs, so our customers get access to latest features, best results, and performance.

We will add the compatibility compatibility note. This is a sound suggestion, thank you!

cc @cchierici @DzmitryFomchyn

cchierici commented 1 year ago

Thank you for your quick answer. This reads to me that search will not work properly with Mapbox v9. Or do you plan to address the issue i mentioned above?

Kind regards

kalbaxa commented 1 year ago

Or do you plan to address the issue i mentioned above?

We will re-consider this in 3 weeks, taking into account the amount effort that would be required to support both. I will let you know @cchierici.

dingdev88 commented 1 year ago

implementation 'com.mapbox.maps:android:10.9.0' implementation "com.mapbox.navigation:android:2.7.0" implementation ("com.mapbox.search:mapbox-search-android:1.0.0-beta.39")

I am using these dependencies, but I am getting same error.

java.lang.RuntimeException: Unable to get provider androidx.startup.InitializationProvider: androidx.startup.StartupException: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN6mapbox6common13EventsServiceC1EONS0_20EventsServiceOptionsE" referenced by "/data/app/~~SJ1CEMouzZWsBNbKOrhYSg==/de.xxx.yyy.dev-xG9CxLRFRi1L74mF_Fbw8w==/base.apk!/lib/arm64-v8a/libmapbox-maps.so"...

I tried with 1.0.0-beta.38 which resulted in build issues due to a duplicated class MapboxCommonLogger. Please update this. thanks.

DzmitryFomchyn commented 1 year ago

@dingdev88 you're using quite an old version of the Navigation SDK https://github.com/mapbox/mapbox-navigation-android/releases/tag/v2.7.0

When picking Mapbox SDK dependencies, they all should have the same/compatible versions of the Common SDK. Common SDK versions used in Mapbox SDKs you can find in the release notes on github: Search, Maps, Navigation.

In your case you declared:

Try picking Navigation SDK 2.9.0-rc.1 or newer.

Let me know if it works for you.

dingdev88 commented 1 year ago

@DzmitryFomchyn
Thanks. It seems works.

DzmitryFomchyn commented 1 year ago

Ok, I'm closing this issue then. Feel free to reopen or create a new one if you have more questions!