mapbox / mapbox-maps-android

Interactive, thoroughly customizable maps in native Android powered by vector tiles and OpenGL.
https://www.mapbox.com/mobile-maps-sdk
Other
475 stars 133 forks source link

Crash for some random users on application start with UnsatisfiedLinkError #2198

Closed Vaudey closed 1 year ago

Vaudey commented 1 year ago

Environment

Observed behavior and steps to reproduce

Never append to me with many tests phone and emulator, we have 10000 people using the app and we have approximatively 50 people who encounters the bug

Expected behavior

Dont crash on start

Notes / preliminary analysis

I drop here the crash logs Fatal Exception: java.lang.RuntimeException: Unable to get provider androidx.startup.InitializationProvider: f5.c: f5.c: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.malakoffhumanis.espaceclient-r8VcEw2pXKmaI7h1ns6QeA==/base.apk"],nativeLibraryDirectories=[/data/app/com.malakoffhumanis.espaceclient-r8VcEw2pXKmaI7h1ns6QeA==/lib/arm64, /system/lib64, /system/vendor/lib64]]] couldn't find "libmapbox-common.so" at android.app.ActivityThread.installProvider(ActivityThread.java:6284) at android.app.ActivityThread.installContentProviders(ActivityThread.java:5847) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5754) at android.app.ActivityThread.-wrap1() at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1670) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6536) at java.lang.reflect.Method.invokeImpl(Method.java) at java.lang.reflect.Method.invoke(Method.java:411) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:468) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:808)

Caused by f5.c: f5.c: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.malakoffhumanis.espaceclient-r8VcEw2pXKmaI7h1ns6QeA==/base.apk"],nativeLibraryDirectories=[/data/app/com.malakoffhumanis.espaceclient-r8VcEw2pXKmaI7h1ns6QeA==/lib/arm64, /system/lib64, /system/vendor/lib64]]] couldn't find "libmapbox-common.so" at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:99) at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:81) at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:51) at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:51) at android.content.ContentProvider.attachInfo(ContentProvider.java:1919) at android.content.ContentProvider.attachInfo(ContentProvider.java:1894) at android.app.ActivityThread.installProvider(ActivityThread.java:6281) at android.app.ActivityThread.installContentProviders(ActivityThread.java:5847) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5754) at android.app.ActivityThread.-wrap1() at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1670) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6536) at java.lang.reflect.Method.invokeImpl(Method.java) at java.lang.reflect.Method.invoke(Method.java:411) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:468) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:808)

Caused by f5.c: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.malakoffhumanis.espaceclient-r8VcEw2pXKmaI7h1ns6QeA==/base.apk"],nativeLibraryDirectories=[/data/app/com.malakoffhumanis.espaceclient-r8VcEw2pXKmaI7h1ns6QeA==/lib/arm64, /system/lib64, /system/vendor/lib64]]] couldn't find "libmapbox-common.so" at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:99) at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:78) at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:81) at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:51) at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:51) at android.content.ContentProvider.attachInfo(ContentProvider.java:1919) at android.content.ContentProvider.attachInfo(ContentProvider.java:1894) at android.app.ActivityThread.installProvider(ActivityThread.java:6281) at android.app.ActivityThread.installContentProviders(ActivityThread.java:5847) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5754) at android.app.ActivityThread.-wrap1() at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1670) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6536) at java.lang.reflect.Method.invokeImpl(Method.java) at java.lang.reflect.Method.invoke(Method.java:411) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:468) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:808)

Caused by java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.malakoffhumanis.espaceclient-r8VcEw2pXKmaI7h1ns6QeA==/base.apk"],nativeLibraryDirectories=[/data/app/com.malakoffhumanis.espaceclient-r8VcEw2pXKmaI7h1ns6QeA==/lib/arm64, /system/lib64, /system/vendor/lib64]]] couldn't find "libmapbox-common.so" at java.lang.Runtime.loadLibrary0(Runtime.java:1029) at java.lang.System.loadLibrary(System.java:1673) at com.mapbox.common.loader.MapboxLibraryLoader.load(:5) at com.mapbox.common.CoreInitializer.create(:13) at com.mapbox.common.CoreInitializer.create() at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:86) at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:78) at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:81) at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:51) at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:51) at android.content.ContentProvider.attachInfo(ContentProvider.java:1919) at android.content.ContentProvider.attachInfo(ContentProvider.java:1894) at android.app.ActivityThread.installProvider(ActivityThread.java:6281) at android.app.ActivityThread.installContentProviders(ActivityThread.java:5847) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5754) at android.app.ActivityThread.-wrap1() at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1670) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6536) at java.lang.reflect.Method.invokeImpl(Method.java) at java.lang.reflect.Method.invoke(Method.java:411) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:468) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:808)

I try the solution with adding this in the manifest but the bug still appears

    <provider
        android:name="androidx.startup.InitializationProvider"
        android:authorities="${applicationId}.androidx-startup"
        android:exported="false"
        tools:node="merge">

    </provider>
Vaudey commented 1 year ago

The issue seems to be linked to couldn't find "libmapbox-common.so"

jush commented 1 year ago

Closing as duplicate of https://github.com/mapbox/mapbox-maps-android/issues/1109

@Vaudey please try the recent snapshot with a fix: https://github.com/mapbox/mapbox-maps-android/issues/1109#issuecomment-1812636156