mapbox / mapbox-search-android Goto Github PK
View Code? Open in Web Editor NEWAndroid SDK for Mapbox Search including preconfigured UI
Home Page: https://docs.mapbox.com/android/search/guides/
License: Other
Android SDK for Mapbox Search including preconfigured UI
Home Page: https://docs.mapbox.com/android/search/guides/
License: Other
Our querySuggestion() method:
return withContext(dispatchers.main()) {
suspendCancellableCoroutine { cont ->
val callback = object : SearchSelectionCallback {
override fun onCategoryResult(
suggestion: SearchSuggestion,
results: List<SearchResult>,
responseInfo: ResponseInfo,
) = Unit
override fun onResult(
suggestion: SearchSuggestion,
result: SearchResult,
responseInfo: ResponseInfo,
) = Unit
override fun onError(e: Exception) = cont.resume(Err(e))
override fun onSuggestions(suggestions: List<SearchSuggestion>, responseInfo: ResponseInfo) {
cont.resume(Ok(suggestions))
}
}
searchTask?.cancel()
val options = proximity?.let { searchOptions.copy(proximity = it) } ?: searchOptions
searchTask = mapboxPlaceSearch.search(query.toString(), options, callback)
}
}
Screen recording of the phone:
searchRequestException1.mp4.zip
The app doesn't crash so that's good, but even with a valid city and postal code(I verified the city and postal code with https://docs.mapbox.com/playground/geocoding/) causes the exception below at SearchSelectionCallback > onError().
SearchRequestException(message='Unknown', code=422, cause=null)
at com.mapbox.search.core.http.HttpClientImpl$makeRequest$1.onResponse(HttpClientImpl.kt:51)
at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
As user types letters or numbers into the search field, it should populate and show a list of suggestions.
Loader not showing on second search in places auto complete activity. First time it show loader when searching places when second time search another place it does not show.
We are expecting it to be compatible with Jetpack compose
SearchEngine
class, and etc.)OfflineSearchEngine
class, and etc.)private val tileRegionId = "Washington DC"
private val tileStore = TileStore.create()
private val descriptors = listOf(OfflineSearchEngine.createTilesetDescriptor())
// Working if coordinates are in US, UK, Mexico, e.g:
// private val dcLocation Point.fromLngLat(-77.0339911055176, 38.899920004207516)
// Not working if coordinates are in HK, Japan, China Mainland
private val dcLocation = Point.fromLngLat(127.024612, 37.532600)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
searchEngine = OfflineSearchEngine.create(
OfflineSearchEngineSettings(
tileStore = tileStore
)
)
searchEngine.addEngineReadyCallback(engineReadyCallback)
searchEngine.addOnIndexChangeListener(object : OfflineSearchEngine.OnIndexChangeListener {
override fun onIndexChange(event: OfflineIndexChangeEvent) {
if (event.regionId == tileRegionId && (event.type == EventType.ADD || event.type == EventType.UPDATE)) {
logI("SearchApiExample", "$tileRegionId was successfully added or updated")
searchRequestTask = searchEngine.reverseGeocoding(
OfflineReverseGeoOptions(center = dcLocation),
searchCallback
)
}
}
override fun onError(event: OfflineIndexErrorEvent) {
logI("SearchApiExample", "Offline index error:", event)
onFinished()
}
})
}
In OfflineSearchKotlinExampleActivity.kt the IndexChangeListener will not be invoked if change the coordinates to HK, Japan, China Mainland, e.g:
private val dcLocation = Point.fromLngLat(114.1547347, 22.2846202) <== HK
private val dcLocation = Point.fromLngLat(127.024612, 37.532600) <== Japan
But the orginal coordinates provided by sample works, and tried GPS in Maxico and UK also works.
The IndexChangeListener should be invoked, and tile should be able to load, and then can perform offline search.
How to get access rights with mobile_build_source for the secret token?
SearchEngine
class, and etc.)OfflineSearchEngine
class, and etc.)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
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.
I would expect it to build with no issues.
1.0.0-beta.37
com.mapbox.maps:android:10.8.1
No code necessary, just adding both dependencies:
implementation "com.mapbox.maps:android:10.8.0"
implementation "com.mapbox.search:mapbox-search-android:1.0.0-beta.37"
When adding both the above dependencies and try to compile the app, the build fails with this error:
Duplicate class com.mapbox.common.MapboxCommonLogger found in modules base-10.8.1-runtime (com.mapbox.maps:base:10.8.1) and common-23.1.0-beta.1-runtime (com.mapbox.common:common:23.1.0-beta.1)
The build should succeed.
implementation "com.mapbox.navigation:android:2.1.1" implementation "com.mapbox.search:mapbox-search-android-ui:1.0.0-beta.24"
2021-12-29 16:07:59.455 12256-12256/com.sfl.navigationsystem E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.sfl.navigationsystem, PID: 12256
java.lang.RuntimeException: Unable to get provider androidx.startup.InitializationProvider: androidx.startup.StartupException: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN6mapbox6common9Scheduler15CreateSequencedEv" referenced by "/data/app/~~5nk1-hA9Bps7Tya4d_wTmg==/com.sfl.navigationsystem-XaTGAx2k2VmsrKVNyxtalg==/lib/arm64/libnavigator-android.so"...
at android.app.ActivityThread.installProvider(ActivityThread.java:7285)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6821)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6716)
at android.app.ActivityThread.access$1300(ActivityThread.java:238)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1914)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7698)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:952)
Caused by: androidx.startup.StartupException: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN6mapbox6common9Scheduler15CreateSequencedEv" referenced by "/data/app/~~5nk1-hA9Bps7Tya4d_wTmg==/com.sfl.navigationsystem-XaTGAx2k2VmsrKVNyxtalg==/lib/arm64/libnavigator-android.so"...
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:162)
at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:198)
at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:38)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2388)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2358)
at android.app.ActivityThread.installProvider(ActivityThread.java:7280)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6821)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6716)
at android.app.ActivityThread.access$1300(ActivityThread.java:238)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1914)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7698)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:952)
Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN6mapbox6common9Scheduler15CreateSequencedEv" referenced by "/data/app/~~5nk1-hA9Bps7Tya4d_wTmg==/com.sfl.navigationsystem-XaTGAx2k2VmsrKVNyxtalg==/lib/arm64/libnavigator-android.so"...
at java.lang.Runtime.loadLibrary0(Runtime.java:1087)
at java.lang.Runtime.loadLibrary0(Runtime.java:1008)
at java.lang.System.loadLibrary(System.java:1664)
at com.mapbox.common.loader.MapboxLibraryLoader.load(MapboxLibraryLoader.kt:19)
at com.mapbox.navigator.MapboxNavigationNativeInitializer.create(MapboxNavigationNativeInitializer.kt:16)
at com.mapbox.navigator.MapboxNavigationNativeInitializer.create(MapboxNavigationNativeInitializer.kt:10)
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:155)
at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:198)
at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:38)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2388)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2358)
at android.app.ActivityThread.installProvider(ActivityThread.java:7280)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6821)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6716)
at android.app.ActivityThread.access$1300(ActivityThread.java:238)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1914)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7698)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:952)
Should work with navigation SDK
👋 Hey there! It's Changebot, and I help repositories follow our engineering best practices. My magic wand found some things I wanted to highlight for your review:
Item | Current status | Required? | Best practice guidelines |
---|---|---|---|
Run unsuccessful: ci/circleci: instrumentation-tests | failure | required | success |
Run unsuccessful: publisher-deployer | neutral | optional | success |
The following PR was merged without the status checks passing: #172
Can you take a look at these best practices and make any adjustments if needed?
Please tag @mapbox/security-and-compliance
on this issue if you have any questions
Categories information may come at the suggestions phase, but Search SDK doesn't expose it for the SearchSuggestion, it's present only for SearchResults.
When I use the map with the search engine:
implementation 'com.mapbox.maps:android:10.4.2'
implementation 'com.mapbox.search:mapbox-search-android:1.0.0-beta.41'
I get a Duplicate class found
error when building the project:
Duplicate class com.mapbox.android.core.location.LocationEngine found in modules jetified-common-23.2.0-rc.3-runtime (com.mapbox.common:common:23.2.0-rc.3) 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.2.0-rc.3-runtime (com.mapbox.common:common:23.2.0-rc.3) 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.2.0-rc.3-runtime (com.mapbox.common:common:23.2.0-rc.3) 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.2.0-rc.3-runtime (com.mapbox.common:common:23.2.0-rc.3) 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.2.0-rc.3-runtime (com.mapbox.common:common:23.2.0-rc.3) 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.2.0-rc.3-runtime (com.mapbox.common:common:23.2.0-rc.3) 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.2.0-rc.3-runtime (com.mapbox.common:common:23.2.0-rc.3) 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.2.0-rc.3-runtime (com.mapbox.common:common:23.2.0-rc.3) 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.2.0-rc.3-runtime (com.mapbox.common:common:23.2.0-rc.3) and jetified-mapbox-android-core-5.0.0-runtime (com.mapbox.mapboxsdk:mapbox-android-core:5.0.0)
Good afternoon, I am developing an application in the city of Ulan-Ude, can I help with providing data to the search system in my city? /
Добрый день я разрабатываю приложение в городе Улан-Удэ могу ли я помочь с предоставление данных в систему поиска по моему городу?
Unfortunately for my city, there are practically no bindings for the coordinates of both streets and certain places. /
К несчастью для моего города практически нет привязок координат как улиц так и определённых мест.
But in the application you can Mapbox Maps SDK, the names of some places in the city and streets are perfectly visible. /
Но в приложении можно Mapbox Maps SDK прекрасно видны наименования некоторых мест города и улиц.
Can I help to provide street data and its end, or house data (Street , House (Latitude,Longitude) ) ? /
Могу помочь предоставить данные улиц и их конец, или данные домов (Улица , Дом (Latitude,Longitude) ) ?
I will also need to know the best language to provide information /
Мне также потребуется, узнать на каком языке лучше предоставлять информацию
With Mapbox SDK just started working
The application is very well developed and ready to help if possible. /
C Mapbox SDK начал работать совсем недавно
Приложение очень хорошо развивается готов помочь если возможно.
Thank you, I hope for a speedy reply. / Спасибо, надеюсь на скорый ответ.
https://github.com/bluelinelabs/Conductor library that's used for view's switching in the Search UI SDK is not quite suitable for the Search SDK case because Conductor relies on the activity lifecycle, whereas views in the Search SDK are standalone and can be used inside fragments or other views.
First, we should research whether there're alternatives for Conductor.
SearchEngine
class, and etc.)OfflineSearchEngine
class, and etc.)placeAutocomplete = PlaceAutocomplete.create(accessToken = getString(R.string.mapbox_access_token))
// placeAutocmplete.
queryEditText = findViewById(R.id.query_text)
lifecycleScope.launchWhenCreated {
val response = placeAutocomplete.suggestions(
query = "Washington DC",
)
response.onValue { suggestions ->
Log.i("SearchApiExample", "Place Autocomplete results: $suggestions")
}.onError { e ->
Log.i("SearchApiExample", "Place Autocomplete error", e)
}
}
I followed the installation steps and this website:
https://docs.mapbox.com/android/search/examples/place-autocomplete-ui/
But apparently Autocomplete always generates this exception:
SearchRequestException(message='{"status_code":401,"error":"The feature is not enabled","version":"63:6196f108d7bac14af1d1b746893a65309aac5867","code":"eJwrLkrWTyzI1M9IzEvJSS0q1i9LzMlMSSxJ1Ssq1jUyswQAx5sLjA=="}', code=401, cause=null)
So I tried a simplified version of the autocomplete feature with this website:
https://docs.mapbox.com/android/search/examples/place-autocomplete/
It generates the same SearchRequestException while my map and GPS work fine:
Place Autocomplete error
SearchRequestException(message='{"status_code":401,"error":"The feature is not enabled","version":"63:6196f108d7bac14af1d1b746893a65309aac5867","code":"eJwrLkrWTyzI1M9IzEvJSS0q1i9LzMlMSSxJ1Ssq1jUyswQAx5sLjA=="}', code=401, cause=null)
at com.mapbox.search.base.utils.extension.SearchResponseErrorKt.toPlatformHttpException(SearchResponseError.kt:12)
at com.mapbox.search.base.engine.TwoStepsRequestCallbackWrapper.run$lambda-7(TwoStepsRequestCallbackWrapper.kt:74)
at com.mapbox.search.base.engine.TwoStepsRequestCallbackWrapper.$r8$lambda$O8P2IEYmBlShaf3i-FSXgZSHENQ(Unknown Source:0)
at com.mapbox.search.base.engine.TwoStepsRequestCallbackWrapper$$ExternalSyntheticLambda0.run(Unknown Source:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:920)
2023
My app does not behave the same as the one shown in the video demo, for both of the sample codes:
https://docs.mapbox.com/android/search/examples/place-autocomplete/
and
https://docs.mapbox.com/android/search/examples/place-autocomplete-ui/
https://docs.mapbox.com/android/search/guides/address-form-fill/
SearchEngine
class, and etc.)OfflineSearchEngine
class, and etc.)Used code from documentation / sample
In Europe and many other countries address format is Street space HouseNumber
but Autofill suggestion start working after fill Number and Char, not before. So until we fill whole Street number it show: No suggestions found
and thats inacceptable!
Compare this two variants:
I expecting show street from Prague after just a few chars like Boriv) but I don't get any results until I fill first number.
Check the videos:
Start suggesting street names
👋 Hey there! It's Changebot, and I help repositories follow our engineering best practices. My magic wand found some things I wanted to highlight for your review:
Item | Current status | Best practice guidelines |
---|---|---|
Pull request state at time of merging | Without review | Approving review before merging |
Merged by | @eugenes78 |
The following pull request was merged without a review: #192
Can you take a look at these best practices and make any adjustments if needed?
Please tag @mapbox/security-and-compliance
on this issue if you have any questions
👋 Hey there! It's Changebot, and I help repositories follow our engineering best practices. My magic wand found some things I wanted to highlight for your review:
Item | Current status | Best practice guidelines |
---|---|---|
Pull request state at time of merging | Without review | Approving review before merging |
Merged by | @mikeringrose |
The following pull request was merged without a review: #230
Can you take a look at these best practices and make any adjustments if needed?
Please tag @mapbox/security-and-compliance
on this issue if you have any questions
From the description it seems that custom data provider must provide all indexable records immediately. Instead I want to query my API based on the input in the search box. Is this scenario supported?
What
The SDK and the playground results are not the same despite setting the same parameters.
Workaround
The language parameter is set automatically in the SDK. To remove this, set var emptyLangs = arrayListOf<Language>()
such that:
var emptyLangs = arrayListOf<Language>()
val list = arrayListOf<QueryType>()
list.add(QueryType.PLACE)
searchRequestTask = searchEngine.search(
"Foo",
SearchOptions(
languages = emptyLangs,
limit = 10,
types = list,
),
searchCallback
)
Search titles are not visible in adapter on Pixel 6 running Android 14
SearchEngine
class, and etc.)OfflineSearchEngine
class, and etc.)App theme: Theme.MaterialComponents.Light.NoActio
nBar
Works fine on OnePlus device with Android 13
MapboxSearchSdk.initialize(this, getKey())
2022-06-06 17:44:31.092 13808-13808/app.test E/AndroidRuntime: FATAL EXCEPTION: main Process: app.test:mapobject, PID: 13808 java.lang.UnsatisfiedLinkError: No implementation found for void com.mapbox.common.EventsService.initialize(com.mapbox.common.EventsServiceOptions) (tried Java_com_mapbox_common_EventsService_initialize and Java_com_mapbox_common_EventsService_initialize__Lcom_mapbox_common_EventsServiceOptions_2) at com.mapbox.common.EventsService.initialize(Native Method) at com.mapbox.common.EventsService.<init>(EventsService.java:15) at com.mapbox.search.analytics.SearchEventsService.<init>(SearchEventsService.kt:18) at com.mapbox.search.MapboxSearchSdk.initializeInternal$mapbox_search_android_release(MapboxSearchSdk.kt:214) at com.mapbox.search.MapboxSearchSdk.initializeInternal$mapbox_search_android_release$default(MapboxSearchSdk.kt:155) at com.mapbox.search.MapboxSearchSdk.initialize(MapboxSearchSdk.kt:142) at com.mapbox.search.MapboxSearchSdk.initialize$default(MapboxSearchSdk.kt:133) at app.AppContext.onCreate(AppContext.kt:127) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1211) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6725) at android.app.ActivityThread.access$1500(ActivityThread.java:247) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2053) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7839) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
When using the search sdk and maps together on the latest versions, the application crashes
If you disable the initialization of the search sdk, then everything is ok
Normal operation of the application is expected
Add regional/country specific house number / street number format. It's reflected on public API / playground, but not in SDK.
As you can see, there are 3 different types how address is formatted.
Most part of EU: Street HouseNumber, City
(without any divider, only space)
Other parts oz world (expect Russia): HouseNumber Street, City
Russia: City, Street HouseNumber
/**
* Format House number and Street name to the most used European format (not all EU countries).
* https://qph.cf2.quoracdn.net/main-qimg-fed2c12535f9552efa214450c4c87881
*/
val SearchAddress.streetWithHouseNumber: String
get() = "${street.orEmpty()} ${houseNumber.orEmpty()}".trim()
Because not all of us live in USA. Because search suggestions should reflect local conventions.
SearchEngine
class, and etc.)OfflineSearchEngine
class, and etc.)"com.mapbox.search:mapbox-search-android:1.0.0-beta.41"
"com.mapbox.maps:android:10.9.1"
implementation "com.mapbox.maps:android:10.9.1"
implementation "com.mapbox.search:mapbox-search-android:1.0.0-beta.41"
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkLocalMockDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
> Duplicate class com.mapbox.android.core.location.LocationEngine found in modules common-23.2.0-rc.3-runtime (com.mapbox.common:common:23.2.0-rc.3) and mapbox-android-core-5.0.2-runtime (com.mapbox.mapboxsdk:mapbox-android-core:5.0.2)
Duplicate class com.mapbox.android.core.location.LocationEngineCallback found in modules common-23.2.0-rc.3-runtime (com.mapbox.common:common:23.2.0-rc.3) and mapbox-android-core-5.0.2-runtime (com.mapbox.mapboxsdk:mapbox-android-core:5.0.2)
Duplicate class com.mapbox.android.core.location.LocationEngineProvider found in modules common-23.2.0-rc.3-runtime (com.mapbox.common:common:23.2.0-rc.3) and mapbox-android-core-5.0.2-runtime (com.mapbox.mapboxsdk:mapbox-android-core:5.0.2)
Duplicate class com.mapbox.android.core.location.LocationEngineRequest found in modules common-23.2.0-rc.3-runtime (com.mapbox.common:common:23.2.0-rc.3) and mapbox-android-core-5.0.2-runtime (com.mapbox.mapboxsdk:mapbox-android-core:5.0.2)
Duplicate class com.mapbox.android.core.location.LocationEngineRequest$Builder found in modules common-23.2.0-rc.3-runtime (com.mapbox.common:common:23.2.0-rc.3) and mapbox-android-core-5.0.2-runtime (com.mapbox.mapboxsdk:mapbox-android-core:5.0.2)
Duplicate class com.mapbox.android.core.location.LocationEngineResult found in modules common-23.2.0-rc.3-runtime (com.mapbox.common:common:23.2.0-rc.3) and mapbox-android-core-5.0.2-runtime (com.mapbox.mapboxsdk:mapbox-android-core:5.0.2)
Duplicate class com.mapbox.android.core.permissions.PermissionsListener found in modules common-23.2.0-rc.3-runtime (com.mapbox.common:common:23.2.0-rc.3) and mapbox-android-core-5.0.2-runtime (com.mapbox.mapboxsdk:mapbox-android-core:5.0.2)
Duplicate class com.mapbox.android.core.permissions.PermissionsManager found in modules common-23.2.0-rc.3-runtime (com.mapbox.common:common:23.2.0-rc.3) and mapbox-android-core-5.0.2-runtime (com.mapbox.mapboxsdk:mapbox-android-core:5.0.2)
Duplicate class com.mapbox.android.core.permissions.PermissionsManager$AccuracyAuthorization found in modules common-23.2.0-rc.3-runtime (com.mapbox.common:common:23.2.0-rc.3) and mapbox-android-core-5.0.2-runtime (com.mapbox.mapboxsdk:mapbox-android-core:5.0.2)
To build the project without an issue.
private fun isCountryWithRegions(country: String?): Boolean = country?.let {
listOf("united states of america", "usa").contains(country.lowercase(Locale.getDefault()))
} ?: false
fun main() {
val result = isCountryWithRegions("United States")
print (result) // returns false because "United States"/"united states" does not contain either "united states of america" or "usa".
}
Because of this, Search results with the country "United States" will not show the region with the default FormatStyle.Medium
. E.g. "17537 Fernwood Drive, Jamestown, California" will just be "17537 Fernwood Drive, Jamestown".
The region will be included.
Hi Mapbox team, first of all, thank you for great Library. It's very helpful to us.
I know this is not related to your Repo, but I could not find the repo or any resources that I can use to report to MapBox team. I posted this with the hope that you can help me reach to them and let them know about this issue. Thank you so much.
The data (locality in context) returns incorrect data
API: https://docs.mapbox.com/playground/search-box/?q=Comedy+Cellar&language=en&country=us&session_token=0eb14ef0-969a-46c1-88d1-b9451650e314
We're using this API and before that it returned the data correctly, but now it doesn't. It should return Manhattan
instead of meaningless character d
in locality.
override suspend fun getAddressFromPoint(point: Point): Either<Failure, List<SearchResult>> {
return suspendCoroutine { continuation ->
mapBoxSearchEngine.search(
ReverseGeoOptions(
center = point,
limit = SEARCH_LIMIT,
types = SEARCH_TYPES
),
object : SearchCallback {
override fun onError(e: Exception) {
if (e is SearchCancellationException) {
Timber.d("Search was cancelled due to new point [point=$point]")
continuation.resumeWith(Result.success(Either.Left(CancellationError)))
} else {
Timber.w(e, "Reverse Geocoding failure [point=$point]")
continuation.resumeWith(
Result.success(Either.Left(MapBoxError.GeocodingError))
)
}
}
override fun onResults(
results: List<SearchResult>,
responseInfo: ResponseInfo
) {
continuation.resumeWith(Result.success(Either.Right(results)))
}
}
)
}
}
Running the above code for any given point, returns the address but NOT the address' number. Reverse Geocoding via MapBox's API returns the address number as well.
The reverse geocoding function to return the address number along with the address.
Integrated following Mapbox dependencies
implementation 'com.mapbox.maps:android:10.15.1'
implementation "com.mapbox.search:place-autocomplete:1.0.0-rc.7"
implementation "com.mapbox.search:autofill:1.0.0-rc.7"
And initialized AddressAutofill with
addressAutofill = AddressAutofill.create(getString(R.string.mapbox_access_token))
But while using suggestions()
to get address list, getting
Cannot access class 'com.mapbox.search.common.IsoLanguageCode'. Check your module classpath for missing or conflicting dependencies`
val addresses = addressAutofill.suggestions(searchQuery!!, AddressAutofillOptions())
Is there any work around this ? or do I need to use the API feature ?
SearchEngine
class, and etc.)OfflineSearchEngine
class, and etc.)Code where we use Search SDK:
suspend fun resolveAddress(latitude: Double, longitude: Double): List<SearchResult> {
val options = ReverseGeoOptions(
center = Point.fromLngLat(longitude, latitude)
)
return geocodingSearchEngine.search(options)
}
internal suspend fun SearchEngine.search(
options: ReverseGeoOptions
): List<SearchResult> =
suspendCancellableCoroutine { continuation ->
val task = search(
options,
object : SearchCallback {
override fun onError(e: Exception) {
if (continuation.isCancelled) {
return
}
continuation.resumeWithException(e)
}
override fun onResults(results: List<SearchResult>, responseInfo: ResponseInfo) {
continuation.resume(results)
}
}
)
continuation.invokeOnCancellation {
task.cancel()
}
}
App crashes on start for 1 user in Crashlytics. It may be the delivery error by the Play Store (it didn't include necessary SO file into the APK during an install) or SDK error (necessary SO is not available for the given architecture, which is unlikely)
Stacktrace:
# Crashlytics - Stack trace
# Application: com.gasanmamo.claims
# Platform: android
# Version: 1.0.6 (13)
# Issue: 513ffd6894244f60388c2500fa974886
# Session: 64B4AB1A031D00010E38BB1596302A83_DNE_0_v2
# Date: Mon Jul 17 2023 05:44:42 GMT+0300 (Eastern European Summer Time)
Fatal Exception: java.lang.RuntimeException: Unable to get provider androidx.startup.InitializationProvider: m5.c: m5.c: m5.c: java.lang.UnsatisfiedLinkError: dlopen failed: library "libmapbox-common.so" not found
at android.app.ActivityThread.installProvider(ActivityThread.java:7289)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6825)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6739)
at android.app.ActivityThread.access$1300(ActivityThread.java:241)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1917)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7702)
at java.lang.reflect.Method.invokeImpl(Method.java)
at java.lang.reflect.Method.invoke(Method.java:425)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:617)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:948)
Caused by m5.c: m5.c: m5.c: java.lang.UnsatisfiedLinkError: dlopen failed: library "libmapbox-common.so" not found
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:98)
at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:81)
at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:50)
at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:50)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2388)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2358)
at android.app.ActivityThread.installProvider(ActivityThread.java:7284)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6825)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6739)
at android.app.ActivityThread.access$1300(ActivityThread.java:241)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1917)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7702)
at java.lang.reflect.Method.invokeImpl(Method.java)
at java.lang.reflect.Method.invoke(Method.java:425)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:617)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:948)
Caused by m5.c: m5.c: java.lang.UnsatisfiedLinkError: dlopen failed: library "libmapbox-common.so" not found
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:98)
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:77)
at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:81)
at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:50)
at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:50)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2388)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2358)
at android.app.ActivityThread.installProvider(ActivityThread.java:7284)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6825)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6739)
at android.app.ActivityThread.access$1300(ActivityThread.java:241)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1917)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7702)
at java.lang.reflect.Method.invokeImpl(Method.java)
at java.lang.reflect.Method.invoke(Method.java:425)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:617)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:948)
Caused by m5.c: java.lang.UnsatisfiedLinkError: dlopen failed: library "libmapbox-common.so" not found
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:98)
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:77)
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:77)
at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:81)
at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:50)
at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:50)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2388)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2358)
at android.app.ActivityThread.installProvider(ActivityThread.java:7284)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6825)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6739)
at android.app.ActivityThread.access$1300(ActivityThread.java:241)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1917)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7702)
at java.lang.reflect.Method.invokeImpl(Method.java)
at java.lang.reflect.Method.invoke(Method.java:425)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:617)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:948)
Caused by java.lang.UnsatisfiedLinkError: dlopen failed: library "libmapbox-common.so" not found
at java.lang.Runtime.loadLibrary0(Runtime.java:1107)
at java.lang.Runtime.loadLibrary0(Runtime.java:1028)
at java.lang.System.loadLibrary(System.java:1664)
at com.mapbox.common.loader.MapboxLibraryLoader.load(:5)
at com.mapbox.common.CoreInitializer.create(CoreInitializer.java:1)
at com.mapbox.common.CoreInitializer.create(CoreInitializer.java:2)
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:85)
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:77)
at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:77)
at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:81)
at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:50)
at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:50)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2388)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2358)
at android.app.ActivityThread.installProvider(ActivityThread.java:7284)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6825)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6739)
at android.app.ActivityThread.access$1300(ActivityThread.java:241)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1917)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7702)
at java.lang.reflect.Method.invokeImpl(Method.java)
at java.lang.reflect.Method.invoke(Method.java:425)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:617)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:948)
Firebase Blocking Thread #0:
at sun.misc.Unsafe.park(Unsafe.java)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:230)
at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:461)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)
at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:937)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1091)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.firebase.concurrent.CustomThreadFactory.lambda$newThread$0(CustomThreadFactory.java:978)
at java.lang.Thread.run(Thread.java:923)
ReferenceQueueDaemon:
at java.lang.Object.wait(Object.java)
at java.lang.Object.wait(Object.java:442)
at java.lang.Object.wait(Object.java:568)
at java.lang.Daemons$ReferenceQueueDaemon.runInternal(Daemons.java:217)
at java.lang.Daemons$Daemon.run(Daemons.java:139)
at java.lang.Thread.run(Thread.java:923)
Firebase Blocking Thread #1:
at sun.misc.Unsafe.park(Unsafe.java)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:230)
at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:461)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)
at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:937)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1091)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.firebase.concurrent.CustomThreadFactory.lambda$newThread$0(CustomThreadFactory.java:978)
at java.lang.Thread.run(Thread.java:923)
Measurement Worker:
at sun.misc.Unsafe.park(Unsafe.java)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:230)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1063)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1358)
at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:278)
at com.google.android.gms.tasks.zzad.zzb(zzad.java:40)
at com.google.android.gms.tasks.Tasks.await(Tasks.java:40)
at com.google.firebase.analytics.FirebaseAnalytics.getFirebaseInstanceId(FirebaseAnalytics.java:10)
at java.lang.reflect.Method.invokeImpl(Method.java)
at java.lang.reflect.Method.invoke(Method.java:425)
at com.google.android.gms.measurement.internal.zzel.zzj(zzel.java:546)
at com.google.android.gms.measurement.internal.zzjy.zzO(zzjy.java:546)
at com.google.android.gms.measurement.internal.zzjy.zzu(zzjy.java:7)
at com.google.android.gms.measurement.internal.zzge.zzH(zzge.java:2068)
at com.google.android.gms.measurement.internal.zzgd.run(zzgd.java:2068)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.google.android.gms.measurement.internal.zzga.run(zzga.java:47)
FinalizerDaemon:
at java.lang.Object.wait(Object.java)
at java.lang.Object.wait(Object.java:442)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:190)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:211)
at java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:273)
at java.lang.Daemons$Daemon.run(Daemons.java:139)
at java.lang.Thread.run(Thread.java:923)
Firebase Background Thread #1:
at sun.misc.Unsafe.park(Unsafe.java)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2067)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.firebase.concurrent.CustomThreadFactory.lambda$newThread$0(CustomThreadFactory.java:978)
at java.lang.Thread.run(Thread.java:923)
Crashlytics Exception Handler1:
at dalvik.system.VMStack.getThreadStackTrace(VMStack.java)
at java.lang.Thread.getStackTrace(Thread.java:1736)
at java.lang.Thread.getAllStackTraces(Thread.java:1812)
at com.google.firebase.crashlytics.internal.common.CrashlyticsReportDataCapture.populateThreadsList(CrashlyticsReportDataCapture.java:225)
at com.google.firebase.crashlytics.internal.common.CrashlyticsReportDataCapture.populateExecutionData(CrashlyticsReportDataCapture.java:225)
at com.google.firebase.crashlytics.internal.common.CrashlyticsReportDataCapture.populateEventApplicationData(CrashlyticsReportDataCapture.java:225)
at com.google.firebase.crashlytics.internal.common.CrashlyticsReportDataCapture.captureEventData(CrashlyticsReportDataCapture.java:225)
at com.google.firebase.crashlytics.internal.common.SessionReportingCoordinator.persistEvent(SessionReportingCoordinator.java:225)
at com.google.firebase.crashlytics.internal.common.SessionReportingCoordinator.persistFatalEvent(SessionReportingCoordinator.java:225)
at com.google.firebase.crashlytics.internal.common.CrashlyticsController$2.call(CrashlyticsController.java:225)
at com.google.firebase.crashlytics.internal.common.CrashlyticsController$2.call(CrashlyticsController.java:225)
at com.google.firebase.crashlytics.internal.common.CrashlyticsBackgroundWorker$3.then(CrashlyticsBackgroundWorker.java:4)
at com.google.android.gms.tasks.zze.run(zze.java:274)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.firebase.crashlytics.internal.common.ExecutorUtils$1$1.onRun(ExecutorUtils.java:2)
at com.google.firebase.crashlytics.internal.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:5)
at java.lang.Thread.run(Thread.java:923)
Firebase Blocking Thread #3:
at sun.misc.Unsafe.park(Unsafe.java)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:230)
at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:461)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)
at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:937)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1091)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.firebase.concurrent.CustomThreadFactory.lambda$newThread$0(CustomThreadFactory.java:978)
at java.lang.Thread.run(Thread.java:923)
Firebase Background Thread #2:
at sun.misc.Unsafe.park(Unsafe.java)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2067)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.firebase.concurrent.CustomThreadFactory.lambda$newThread$0(CustomThreadFactory.java:978)
at java.lang.Thread.run(Thread.java:923)
com.google.firebase.crashlytics.startup1:
at sun.misc.Unsafe.park(Unsafe.java)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2067)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.firebase.crashlytics.internal.common.ExecutorUtils$1$1.onRun(ExecutorUtils.java:2)
at com.google.firebase.crashlytics.internal.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:5)
at java.lang.Thread.run(Thread.java:923)
Firebase Blocking Thread #2:
at sun.misc.Unsafe.park(Unsafe.java)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:230)
at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:461)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)
at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:937)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1091)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.firebase.concurrent.CustomThreadFactory.lambda$newThread$0(CustomThreadFactory.java:978)
at java.lang.Thread.run(Thread.java:923)
queued-work-looper:
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:335)
at android.os.Looper.loop(Looper.java:183)
at android.os.HandlerThread.run(HandlerThread.java:67)
Firebase Background Thread #3:
at libcore.io.Linux.openImpl(Linux.java)
at libcore.io.Linux.open(Linux.java:159)
at libcore.io.ForwardingOs.open(ForwardingOs.java:166)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:254)
at libcore.io.ForwardingOs.open(ForwardingOs.java:166)
at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7588)
at libcore.io.IoBridge.open(IoBridge.java:478)
at java.io.FileInputStream.<init>(FileInputStream.java:160)
at com.google.firebase.installations.local.PersistedInstallation.readJSONFromFile(PersistedInstallation.java:15)
at com.google.firebase.installations.local.PersistedInstallation.readPersistedInstallationEntryValue(PersistedInstallation.java:15)
at com.google.firebase.installations.FirebaseInstallations.getPrefsWithGeneratedIdMultiProcessSafe(FirebaseInstallations.java:16)
at com.google.firebase.installations.FirebaseInstallations.doRegistrationOrRefresh(FirebaseInstallations.java:16)
at com.google.firebase.installations.FirebaseInstallations.lambda$getId$1(FirebaseInstallations.java:13)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.firebase.concurrent.CustomThreadFactory.lambda$newThread$0(CustomThreadFactory.java:978)
at java.lang.Thread.run(Thread.java:923)
ScionFrontendApi:
at sun.misc.Unsafe.park(Unsafe.java)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:230)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2109)
at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1091)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Firebase Background Thread #0:
at sun.misc.Unsafe.park(Unsafe.java)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2067)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.firebase.concurrent.CustomThreadFactory.lambda$newThread$0(CustomThreadFactory.java:978)
at java.lang.Thread.run(Thread.java:923)
awaitEvenIfOnMainThread task continuation executor1:
at sun.misc.Unsafe.park(Unsafe.java)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2067)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at com.google.firebase.crashlytics.internal.common.ExecutorUtils$1$1.onRun(ExecutorUtils.java:2)
at com.google.firebase.crashlytics.internal.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:5)
at java.lang.Thread.run(Thread.java:923)
pool-7-thread-1:
at sun.misc.Unsafe.park(Unsafe.java)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:190)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2067)
at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1092)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
FinalizerWatchdogDaemon:
at java.lang.Object.wait(Object.java)
at java.lang.Object.wait(Object.java:442)
at java.lang.Object.wait(Object.java:568)
at java.lang.Daemons$FinalizerWatchdogDaemon.sleepUntilNeeded(Daemons.java:341)
at java.lang.Daemons$FinalizerWatchdogDaemon.runInternal(Daemons.java:321)
at java.lang.Daemons$Daemon.run(Daemons.java:139)
at java.lang.Thread.run(Thread.java:923)
App starts just fine, initialization happens without issues.
SearchEngine
class, and etc.)OfflineSearchEngine
class, and etc.)val callback = object : SearchCallback {
override fun onResults(results: List<SearchResult>, responseInfo: ResponseInfo) {
val result = results.firstOrNull() ?: return
val address = result.address ?: return
val formatted = address.formattedAddress(SearchAddress.FormatStyle.Long) ?: return
continuation.resume(formatted)
}
override fun onError(e: Exception) {
Timber.tag("MapboxUtil").e(e)
}
}
search(ReverseGeoOptions(coordinates.asPoint, limit = 1), Executors.newSingleThreadExecutor() , callback)
Geocoding [84.0375137, 28.1715234]
and formatting the address with FormatStyle.Long
results to:
Lekhnath Kaski District, Gandaki, Nepal
When it should be:
Lekhnath, Kaski District, Gandaki, Nepal
It is because on fun formattedAddress(style: FormatStyle = FormatStyle.Medium): String?
, it omits the separator when the first component on the FormatStyle
is HOUSE_NUMBER
, but it does not check if the first non-null field is actually HOUSE_NUMBER
.
My workaround is to create a custom FormatStyle without HOUSE_NUMBER
SDK initialization:
applicationScope.launch(dispatcher.main()) {
Mapbox.getInstance(
this@HatchApplication,
getString(hatch.features.rewards.R.string.mapbox_access_token),
)
}
applicationScope.launch(dispatcher.io()) {
MapboxSearchSdk.initialize(
this@HatchApplication,
getString(hatch.features.rewards.R.string.mapbox_access_token),
DefaultLocationProvider(this@HatchApplication)
)
}
querySuggestion:
return withContext(dispatchers.main()) {
suspendCancellableCoroutine { cont ->
val callback = object : SearchSelectionCallback {
override fun onCategoryResult(
suggestion: SearchSuggestion,
results: List<SearchResult>,
responseInfo: ResponseInfo,
) = Unit
override fun onResult(
suggestion: SearchSuggestion,
result: SearchResult,
responseInfo: ResponseInfo,
) = Unit
override fun onError(e: Exception) = cont.resume(Err(e))
override fun onSuggestions(suggestions: List<SearchSuggestion>, responseInfo: ResponseInfo) {
cont.resume(Ok(suggestions))
}
}
searchTask?.cancel()
val options = proximity?.let { searchOptions.copy(proximity = it) } ?: searchOptions
searchTask = mapboxPlaceSearch.search(query.toString(), options, callback)
}
}
run app, wait for app to launch, observes this error on logcat as the app hangs and remains unresponsive.
2022-05-10 11:09:09.114 772-787/? E/ActivityManager: ANR in com.hatchcard.android.debug
PID: 8787
Reason: executing service com.hatchcard.android.debug/com.mapbox.android.telemetry.MapboxTelemetryService
Load: 14.62 / 9.89 / 4.09
CPU usage from 7613ms to 0ms ago (2022-05-10 11:08:58.758 to 2022-05-10 11:09:06.372):
9.8% 8102/com.google.android.calendar: 8.9% user + 0.9% kernel / faults: 6720 minor
2.6% 772/system_server: 1.1% user + 1.4% kernel / faults: 33 minor
1.1% 8787/com.hatchcard.android.debug: 0.9% user + 0.2% kernel / faults: 119 minor
0.7% 1505/com.android.systemui: 0.5% user + 0.2% kernel / faults: 27 minor
0.6% 417/kworker/u16:4: 0% user + 0.6% kernel
0.5% 432/surfaceflinger: 0.2% user + 0.2% kernel
0% 5375/kworker/1:3: 0% user + 0% kernel
0.3% 430/msm_irqbalance: 0.1% user + 0.2% kernel
0.3% 6121/com.google.android.apps.turbo:aab: 0.2% user + 0.1% kernel / faults: 86 minor
0.2% 10/rcu_preempt: 0% user + 0.2% kernel
0.2% 31/kworker/0:1: 0% user + 0.2% kernel
0.2% 38/kworker/u16:1: 0% user + 0.2% kernel
0.2% 302/msm-core:sampli: 0% user + 0.2% kernel
0.2% 426/[email protected]: 0.1% user + 0.1% kernel
0.2% 484/irq/215-fc38800: 0% user + 0.2% kernel
0.2% 573/thermal-engine: 0% user + 0.2% kernel
0.1% 3/ksoftirqd/0: 0% user + 0.1% kernel
0.1% 15/ksoftirqd/1: 0% user + 0.1% kernel
0.1% 16/kworker/1:0: 0% user + 0.1% kernel
0.1% 25/ksoftirqd/3: 0% user + 0.1% kernel
0% 35/kworker/1:1H: 0% user + 0% kernel
0.1% 40/kworker/u17:0: 0% user + 0.1% kernel
0.1% 42/kworker/u17:1: 0% user + 0.1% kernel
0.1% 161/vsync_retire_wo: 0% user + 0.1% kernel
0.1% 205/spi5: 0% user + 0.1% kernel
0.1% 209/kworker/u16:3: 0% user + 0.1% kernel
0.1% 250/cfinteractive: 0% user + 0.1% kernel
0.1% 259/mmcqd/0: 0% user + 0.1% kernel
0.1% 331/ueventd: 0% user + 0.1% kernel
0.1% 346/kworker/u17:3: 0% user + 0.1% kernel
0.1% 349/kworker/u17:5: 0% user + 0.1% kernel
0.1% 368/logd: 0% user + 0.1% kernel
0.1% 427/healthd: 0% user + 0.1% kernel
0.1% 431/lmkd: 0% user + 0.1% kernel
0.1% 564/jbd2/dm-2-8: 0% user + 0.1% kernel
0.1% 596/wificond: 0% user + 0.1% kernel
0.1% 2503/com.google.android.gms.persistent: 0.1% user + 0% kernel / faults: 1 minor
0.1% 3860/com.agilebits.onepassword: 0.1% user + 0% kernel / faults: 1 minor
0.1% 5386/kworker/0:5: 0% user + 0.1% kernel
0.1% 6936/kworker/3:3: 0% user + 0.1% kernel
0.1% 7244/com.google.android.youtube: 0.1% user + 0% kernel
0.1% 8060/com.google.android.apps.walletnfcrel: 0.1% user + 0% kernel / faults: 1 minor
0.1% 8592/com.lilly.deloitte.vega: 0.1% user + 0% kernel / faults: 4 minor
0.1% 8856/com.google.android.gms.unstable: 0.1% user + 0% kernel / faults: 10 minor
3% TOTAL: 1.7% user + 0.8% kernel + 0% iowait + 0.3% softirq
CPU usage from 79ms to 499ms later (2022-05-10 11:09:06.450 to 2022-05-10 11:09:06.870):
36% 772/system_server: 12% user + 24% kernel / faults: 403 minor
39% 787/ActivityManager: 15% user + 24% kernel
3% 772/system_server: 3% user + 0% kernel
2.4% 44/irq/51-cpr: 0% user + 2.4% kernel
2.6% 259/mmcqd/0: 0% user + 2.6% kernel
3.1% 2503/com.google.android.gms.persistent: 0% user + 3.1% kernel / faults: 1 minor
3.1% 2503/.gms.persistent: 0% user + 3.1% kernel
3.9% 8787/com.hatchcard.android.debug: 3.9% user + 0% kernel
3.9% 8815/plumber-android: 3.9% user + 0% kernel
7.8% TOTAL: 2.7% user + 5.1% kernel
2022-05-10 11:09:27.066 772-792/? E/BatteryExternalStatsWorker: no controller energy info supplied for bluetooth
2022-05-10 11:10:27.016 2503-3356/? E/baqn: Phenotype API error. Event # cvpe@65c4bb15, EventCode: 5 [CONTEXT service_id=51 ]
bapp: 29501: Stale snapshot for com.google.android.libraries.consentverifier#com.google.android.tts(change count changed - expected 17 but was 16)
at baqs.b(:com.google.android.gms@[email protected] (040400-441847897):14)
at baqq.g(:com.google.android.gms@[email protected] (040400-441847897):0)
at baqn.e(:com.google.android.gms@[email protected] (040400-441847897):4)
at baqn.f(:com.google.android.gms@[email protected] (040400-441847897):2)
at agzc.en(:com.google.android.gms@[email protected] (040400-441847897):1)
at agzi.run(:com.google.android.gms@[email protected] (040400-441847897):11)
at cdcj.run(:com.google.android.gms@[email protected] (040400-441847897):2)
at xyb.c(:com.google.android.gms@[email protected] (040400-441847897):6)
at xyb.run(:com.google.android.gms@[email protected] (040400-441847897):7)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at ydg.run(:com.google.android.gms@[email protected] (040400-441847897):0)
at java.lang.Thread.run(Thread.java:764)
able to see login screen, proceed to login, take user input on button clicks after login.
Make AddressAutofill, PlaceAutocomplete and SearchEngine (all dependent on LocationEngine) work without location permission.
In our app we want to make user's life easier by providing autocompletion, we are not interested in their location at that particular moment. After migration to MapBox SDK we have to respond to complains why autocompletion is not available without giving access to the location. And I think this concern is absolutely reasonable.
👋 Hey there! It's Changebot, and I help repositories follow our engineering best practices. My magic wand found some things I wanted to highlight for your review:
Item | Current status | Best practice guidelines |
---|---|---|
Run unsuccessful: ci/circleci: instrumentation-tests | failure | success |
Run unsuccessful: publisher-deployer | neutral | success |
The following PR was merged without the status checks passing: #160
Can you take a look at these best practices and make any adjustments if needed?
Please tag @mapbox/security-and-compliance
on this issue if you have any questions
👋 Hey there! It's Changebot, and I help repositories follow our engineering best practices. My magic wand found some things I wanted to highlight for your review:
Item | Current status | Required? | Best practice guidelines |
---|---|---|---|
Run unsuccessful: ci/circleci: instrumentation-tests | failure | required | success |
Run unsuccessful: publisher-deployer | neutral | optional | success |
The following PR was merged without the status checks passing: #192
Can you take a look at these best practices and make any adjustments if needed?
Please tag @mapbox/security-and-compliance
on this issue if you have any questions
SearchEngine
class, and etc.)OfflineSearchEngine
class, and etc.)Favorited item is not remembered in SearchPlaceBottomSheetView once app restarts, I am sorry but do you guys even test this SDK? Core implementation is solid, but these kind of bugs are surprising.
In the list with results it is marked as favorite, but on bottom sheet not, I can add it again to favorites, even though it is already there.
👋 Hey there! It's Changebot, and I help repositories follow our engineering best practices. My magic wand found some things I wanted to highlight for your review:
Item | Current status | Best practice guidelines |
---|---|---|
main branch protection: Dismiss stale pull request approvals when new commits are pushed | Unchecked | Checked |
main branch protection: Restrict who can push to this branch | Unchecked | Checked |
Can you take a look at these best practices and make any adjustments if needed?
Please tag @mapbox/security-and-compliance
on this issue if you have any questions
Unable to start activity ComponentInfo{com.xxx.xxx.debug/comxxx.xxx.module.growthmonitor.activity.MapBoxGrowthMonitorActivity}: android.view.InflateException: Binary XML file line #17 in com.xxx.xxx.debug:layout/mapbox_growth_monitor_activity: Binary XML file line #17 in com.xxx.xxx.debug:layout/mapbox_growth_monitor_activity: Error inflating class com.mapbox.maps.MapView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3790)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3957)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:106)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2335)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.