yandex / mapkit-android-demo

MapKit Android demo
Other
122 stars 60 forks source link

Fatal Exception: java.lang.UnsatisfiedLinkError #234

Closed v-grishechko closed 1 month ago

v-grishechko commented 3 years ago

Hi. We experience a crash on some devices due to absent corresponding .so library. Full logs:

Fatal Exception: java.lang.UnsatisfiedLinkError: Couldn't load maps-mobile, reason: lib/armeabi/libmaps-mobile.so at com.yandex.runtime.Runtime.loadLibrary(Runtime.java:123) at com.yandex.runtime.Runtime.init(Runtime.java:96) at com.yandex.runtime.Runtime.init(Runtime.java:103) at com.yandex.mapkit.MapKitFactory.initialize(MapKitFactory.java:25) at com.yandex.mapkit.search.SearchFactory.initialize(SearchFactory.java:12) at com.example.app.initializer.ProcessDependentInitializer.setUpYandexMapKit(ProcessDependentInitializer.java:125) at com.example.app.initializer.ProcessDependentInitializer.initializeProcessDependentComponents(ProcessDependentInitializer.java:65) at com.example.app.initializer.ProcessDependentInitializer.initialize(ProcessDependentInitializer.java:50) at com.example.app.MApplication.onCreate(MApplication.java:67) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1019) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4980) at android.app.ActivityThread.-wrap1(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1562) at android.os.Handler.dispatchMessage(Handler.java:111) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:5811) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:802) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:692)

Libs versions:

mapkit          : "com.yandex.android:maps.mobile:4.0.0-full",
search          : "com.yandex.android:search:3.5.0",
oauth           : "com.yandex.android:authsdk:2.0.0"

Firebase crash statistics of devices:

How we can fix it or just wait future library update?

v-grishechko commented 3 years ago

@eberkovich Hi. Any response?)

v-grishechko commented 3 years ago

@eberkovich Soft reminder, some users can't start our app. Maybe I need to add more info about the crash?

TheMrButcher commented 3 years ago

lib/armeabi/libmaps-mobile.so is an armv7 (32-bit) version of library. Did you include this arch and corresponding version of lib in your app?

TheMrButcher commented 3 years ago

Galaxy A5 is an armv7 device.

v-grishechko commented 3 years ago

@TheMrButcher We deploy the bundle on google play. But if build debug apk, there no .so library by this path (lib/armeabi/libmaps-mobile.so): image

Also, we don't have some special configuration for splitting and filtering ABI in Gradle configs

v-grishechko commented 3 years ago

@TheMrButcher Hi. Some updates about this bug? )

TheMrButcher commented 3 years ago

"we don't have some special configuration for splitting and filtering ABI in Gradle configs" May be that is the problem. Please can you manually specify these 4 archs in abiFilters?

v-grishechko commented 3 years ago

@TheMrButcher I've analyzed apk, which user with problematic device receives from google play and there found this library: image

It means that the user already have the correct ABI lib, but despite this crash happens. I can send a list of devices on which the crash occurs. May be it can help reproduce this crash.

TheMrButcher commented 3 years ago

AFAIK armeabi and armeabi-v7a are not the same. We do not compile MapKit for armeabi, only for armeabi-v7a. I think that on some devices ReLinker tries to load armeabi version because abi filters are not specified and all archs are allowed.

v-grishechko commented 3 years ago

@TheMrButcher And how to solve this issue? Can you compile armeabi version?

bigman212 commented 3 years ago

I've encountered this issue too. Most crashes on:

We create bundles for Google Play, and APKs for AppGallery. Version com.yandex.android:maps.mobile:4.0.0-lite

Any updates on the issue? @TheMrButcher

beibuttukibayev commented 2 years ago

We have the same issue for 4.0.0-full most commonly on Huawei and Samsung devices (Android 7, 8, 9) Any updates on the issue? @TheMrButcher

vkatzyn commented 1 year ago

Seeing this crash in our app using 4.1.0-full version Here's a list of devices and their OS versions that got this crash in the recent couple of months, hope that's useful

image
PStrelchenko commented 1 year ago

Also seeing this crash in our app using com.yandex.android:maps.mobile:4.2.1-lite.

We use App Bundle for our app distribution. Our setup for it in convention plugin is:

import com.android.build.gradle.BaseExtension

@Suppress("UnstableApiUsage")  
fun BaseAppModuleExtension.setupAppBundle() {  
    bundle {  
        language {  
            enableSplit = true  
        }  
        density {  
            enableSplit = true  
        }  
        abi {  
            enableSplit = true  
        }  
    }
}

Don't sure why (we are kinda a desperate people about this crash 😔) but we add also the following block into defaultConfig:

import com.android.build.gradle.internal.dsl.BaseAppModuleExtension

@Suppress("UnstableApiUsage")  
fun BaseAppModuleExtension.setupSupportedAbi() {  
    defaultConfig {  
        ndk {  
            abiFilters.addAll(  
                listOf(  
                    "arm64-v8a",  
                    "armeabi-v7a",  
                    "x86",  
                    "x86_64"  
                )  
            )  
        }  
    } 
}

Anyway, we have a lot of crashes among our users, with different devices and different ABI. Hope this information help:

Model OS version Supported ABI
Aosp On IA Emulator 7.0 x86, armeabi-v7a, armeabi
Nexus 5X 8.1.0 x86
Nexus 5X 6.0.1 armeabi-v7a, armeabi, x86
真我 GT NEO 3 13 arm64-v8a, armeabi-v7a, armeabi
Redmi Note 9S 12 arm64-v8a, armeabi-v7a, armeabi
Poco F3 13 arm64-v8a, armeabi-v7a, armeabi
V2061 12 arm64-v8a, armeabi-v7a, armeabi

How do we get supported ABI list:

import android.os.Build
import android.content.Context

@Suppress("DEPRECATION")  
fun Context.getSupportedAbis(): Array<String> {  
    return when {  
        Build.SUPPORTED_ABIS.isNotEmpty() -> Build.SUPPORTED_ABIS  
        Build.CPU_ABI2.isNotEmpty() -> arrayOf(Build.CPU_ABI, Build.CPU_ABI2)  
        else -> arrayOf(Build.CPU_ABI)  
    }  
}

Also some information without ABI info (we did not think to collect this information from the beggining):

Hope this could help you anyhow.

May be you have some assumptions, where should we dig more information about this crash, how to fix it?

ilyastoletov commented 8 months ago

There is still same issue on com.yandex.android:maps.mobile:4.4.0-lite

Devices affected:

Tried different solutions, but none of them helped.

YandexMapKit commented 8 months ago

If you can, send us a minimal compiled example, that demonstrates the situation. It can be uploaded on GitHub, attached to mail as an archive, or uploaded to Yandex Disk and sent to us via link.

We will try to find a solution.

Arkuda commented 7 months ago

Hi all, same problem, affects android 13 and 14. Using aab. Lib ver - 4.0.0-full Devices:

YandexMapKit commented 7 months ago

We still need a minimal example of the application code, which we can assemble to reproduce the situation in our environment.

HrayrHovsepyan commented 5 months ago

same issue from me com.yandex.android:maps.mobile:4.4.0-lite

Devices affected: Xiaomi 11T android14

YandexMapKit commented 5 months ago

We need a minimal sample code that we can assemble to reproduce the situation in our environment. It can be uploaded to GitHub or any other file sharing service.

Kratos1013 commented 4 months ago

Здравствуйте! Такая ошибка присутствует на 4.6.1-full потому что вы убрали

SearchFactory.initialize(this)

я снизил версия библиотеки до 4.4.0-full и все работает. Думаю вы не инициализируете SearchFactory и убрали возможность вручную инициализировать

YandexMapKit commented 4 months ago

Здравствуйте, @Kratos1013!

Нам очень поможет свежий пример проекта, который позволит наглядно воспроизвести ошибку. Пожалуйста, оформите его и загрузите на любой удобный файлообменник. В том числе можно загрузить проект в GitHub и прислать на него ссылку.

Arkuda commented 2 months ago

@YandexMapKit Столкнулись с той же самой проблемой. Уже в другом приложении, крашей оч много. Воспроизводиться должно даже на коде из сэмпла. Только собирать обязательно в релизе. По статистике это начиная с 9 и по 14 включительно и на разных вендорах/моделях Discover_2024-August-29_441 (1).csv

YandexMapKit commented 2 months ago

Мы не можем воспроизвести и отловить описанную проблему без минимального примера кода, на котором такую ошибку с достаточной степенью стабильности можно было бы получить. Пожалуйста, соберите подобный пример и выложите его проектом на GitHub или ссылкой на архив в Яндекс Диске или ином хранилище.

romankulykov commented 1 month ago

Ошибка при загрузке нативной библиотеки на Android 15 (API 35)

Описание проблемы: При попытке инициализации Yandex Maps SDK на устройстве с Android 15 (API 35) возникает ошибка загрузки нативной библиотеки. Эта проблема воспроизводится как в существующем проекте, так и в новом чистом проекте.

Сообщение об ошибке: java.lang.UnsatisfiedLinkError: dlopen failed: empty/missing DT_HASH/DT_GNU_HASH in "/data/app/~~4NMPv6xgUj1ehLsaZbtDLg==/dev.roman.testyandexmapapp-5IA02AuBIbY54AQm9XM7cQ==/base.apk!/lib/arm64-v8a/libmaps-mobile.so" (new hash type from the future?)

Шаги для воспроизведения:

  1. Создать новый проект Android
  2. Добавить зависимость Yandex Maps SDK (версия 4.8.0-lite)
  3. Инициализировать MapKit в коде
  4. Запустить приложение на устройстве или эмуляторе с Android 15 (API 35)

Ожидаемое поведение: SDK должен успешно инициализироваться без ошибок.

Фактическое поведение: Приложение крашится с ошибкой UnsatisfiedLinkError при попытке загрузить нативную библиотеку.

Дополнительная информация:

Характеристики эмулятора:

Прошу рассмотреть этот вопрос и предоставить решение или обходной путь для использования SDK на Android 15.

Ссылка на проект: https://github.com/romankulykov/TestYandexMapApp/tree/main

@YandexMapKit Please take a look ASAP. Thanks!

YandexMapKit commented 1 month ago

Сейчас MapKit не поддерживает 16 КБ страницы. Мы рассмотрим возможность добавления такой поддержки в будущих версиях. Каких-либо сроков такой доработки пока назвать не сможем.

georrge1994 commented 1 month ago

Правильно, проблема на "нашей стороне". На вашей ей метрики и закрытые таски. Та же самая проблема: Fatal Exception: java.lang.UnsatisfiedLinkError: Couldn't load maps-mobile, reason: lib/armeabi/libmaps-mobile.so at com.yandex.runtime.Runtime.loadLibrary(Runtime.java:36) at com.yandex.runtime.Runtime.init(Runtime.java:2) at com.yandex.runtime.Runtime.init(Runtime.java:1) at com.yandex.mapkit.MapKitFactory.initialize(:6) at com.android.feature.map.repositories.MapKitInitializer.initialize$feature_map_release(MapKitInitializer.java:15) at com.android.feature.map.fragments.MapFragment.onCreate(MapFragment.java:14) at androidx.fragment.app.Fragment.performCreate(Fragment.java:26) at androidx.fragment.app.FragmentStateManager.create(FragmentStateManager.java:49) at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:129) at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:230) at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:91) at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:21) at androidx.fragment.app.FragmentManager$5.run(FragmentManager.java:3) at android.os.Handler.handleCallback(Handler.java:966) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loopOnce(Looper.java:205) at android.os.Looper.loop(Looper.java:293) at android.app.ActivityThread.loopProcess(ActivityThread.java:9998) at android.app.ActivityThread.main(ActivityThread.java:9987) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:586) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1240) Устройства на которых возник краш за последнюю неделю: Xiaomi 13, Huawei NOH-AN00, Huawei ALN-AL00

Реализацию можно посмотреть здесь, исходный код проекта открытый: https://github.com/georrge1994/polykek-schedule-app/tree/main/polykek-schedule/features/feature-map Уж как-нибудь выцепите один модуль, справитесь?