mapkit-android-demo icon indicating copy to clipboard operation
mapkit-android-demo copied to clipboard

Fatal Exception: java.lang.UnsatisfiedLinkError

Open v-grishechko opened this issue 4 years ago • 22 comments

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 avatar Feb 09 '21 15:02 v-grishechko

@eberkovich Hi. Any response?)

v-grishechko avatar Feb 15 '21 12:02 v-grishechko

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

v-grishechko avatar Feb 23 '21 09:02 v-grishechko

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 avatar Feb 23 '21 16:02 TheMrButcher

Galaxy A5 is an armv7 device.

TheMrButcher avatar Feb 23 '21 16:02 TheMrButcher

@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 avatar Feb 24 '21 08:02 v-grishechko

@TheMrButcher Hi. Some updates about this bug? )

v-grishechko avatar Mar 01 '21 13:03 v-grishechko

"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?

TheMrButcher avatar Mar 03 '21 14:03 TheMrButcher

@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.

v-grishechko avatar Mar 11 '21 11:03 v-grishechko

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.

TheMrButcher avatar Mar 30 '21 00:03 TheMrButcher

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

v-grishechko avatar Mar 30 '21 05:03 v-grishechko

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

  • Android 7, Android 8
  • ONEPLUS A5000, SAMSUNG A5, SAMSUNG A3, HUAWEI Y3III

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

bigman212 avatar Sep 29 '21 10:09 bigman212

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

beibuttukibayev avatar Jan 13 '22 07:01 beibuttukibayev

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

vkatzyn avatar Dec 06 '22 11:12 vkatzyn

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):

  • Affected models:
    • Samsungs
      • Galaxy J6+
      • Galaxy S22
      • Galaxy A51
      • Galaxy A8+(2018)
      • Galaxy S20 Ultra 5G
      • Galaxy M12
      • Galaxy A53 5G
      • Galaxy M31s
    • Xiaomi
      • Redmi 9T
      • Redmi 7
      • Redmi 9A
      • Redmi Note 10S
      • Redmi Note 10 Pro
      • Redmi 10 2022
      • Poco X3 Pro
      • Redmi Note 9S
    • Honor
      • Honor 50
      • Honor X8
      • Honor 50 Lite
      • Honor 70
      • Honor X8a
    • Oppo
      • Realme C35
      • RMX3231
      • Realme 9
      • Realme 10
      • Realme 6Pro
      • Realme XT
  • Affected OS versions:
    • Android 6 --> Android 13 (all supported versions of our app)
  • Devices states: foreground 99%

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?

PStrelchenko avatar Apr 03 '23 13:04 PStrelchenko

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

Devices affected:

  • Oppo Realme RMX3771
  • OnePlus 8 PRO

Tried different solutions, but none of them helped.

ilyastoletov avatar Feb 22 '24 07:02 ilyastoletov

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.

YandexMapKit avatar Mar 11 '24 15:03 YandexMapKit

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

  • Samsung Galaxy S21 5G
  • Samsung Galaxy A54 5G
  • Poco X5
  • Xiaomi Redmi 12 5G

Arkuda avatar Mar 28 '24 09:03 Arkuda

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

YandexMapKit avatar Mar 28 '24 16:03 YandexMapKit

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

Devices affected: Xiaomi 11T android14

HrayrHovsepyan avatar May 30 '24 08:05 HrayrHovsepyan

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.

YandexMapKit avatar May 30 '24 10:05 YandexMapKit

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

SearchFactory.initialize(this)

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

Kratos1013 avatar Jun 21 '24 20:06 Kratos1013

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

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

YandexMapKit avatar Jun 21 '24 20:06 YandexMapKit