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 at startup #2054

Closed akirmse closed 11 months ago

akirmse commented 1 year ago

Environment

Only reported from this user device, which is not rooted.

Fatal Exception: java.lang.RuntimeException: Unable to get provider androidx.startup.InitializationProvider: c2.c: c2.c: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.mountainside.peakbagger-Z4dP6VCw8dxWXer_ZAlU0Q==/base.apk"],nativeLibraryDirectories=[/data/app/com.mountainside.peakbagger-Z4dP6VCw8dxWXer_ZAlU0Q==/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libmapbox-common.so"
       at android.app.ActivityThread.installProvider(ActivityThread.java:6242)
       at android.app.ActivityThread.installContentProviders(ActivityThread.java:5805)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5722)
       at android.app.ActivityThread.-wrap1(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:6494)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
fluttermoonger commented 1 year ago

Also have seen this issue. But it seems to happen at random. When running GCE

iamwent commented 1 year ago

I have the same crash with Mapbox 10.12.0 & Nexus 5X 8.1.0

kiryldz commented 1 year ago

Could you please check if following helps?

akirmse commented 1 year ago

I can't reproduce this myself. It has happened on these user devices:

I don't have any code that configures Android's InitializationProvider. Any ideas why this would happen only on certain devices?

AndriiYanechko commented 1 year ago

Got the same crash on the Firebase:

Screenshot 2023-05-16 at 12 13 21 PM



Some stack traces ```Sd Fatal Exception: java.lang.RuntimeException: Unable to get provider androidx.startup.InitializationProvider: androidx.startup.StartupException: androidx.startup.StartupException: androidx.startup.StartupException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/APPLICATION.PACKAGE.DA-xirhmP3vZLsbo3R-t6vbKA==/base.apk"],nativeLibraryDirectories=[/data/app/APPLICATION.PACKAGE.DA-xirhmP3vZLsbo3R-t6vbKA==/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libmapbox-common.so" at android.app.ActivityThread.installProvider(ActivityThread.java:6242) at android.app.ActivityThread.installContentProviders(ActivityThread.java:5805) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5722) at android.app.ActivityThread.-wrap1() at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) Caused by androidx.startup.StartupException: androidx.startup.StartupException: androidx.startup.StartupException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/APPLICATION.PACKAGE.DA-xirhmP3vZLsbo3R-t6vbKA==/base.apk"],nativeLibraryDirectories=[/data/app/APPLICATION.PACKAGE.DA-xirhmP3vZLsbo3R-t6vbKA==/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libmapbox-common.so" at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:187) at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:238) at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:206) at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:45) at android.content.ContentProvider.attachInfo(ContentProvider.java:1917) at android.content.ContentProvider.attachInfo(ContentProvider.java:1892) at android.app.ActivityThread.installProvider(ActivityThread.java:6239) at android.app.ActivityThread.installContentProviders(ActivityThread.java:5805) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5722) at android.app.ActivityThread.-wrap1() at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) Caused by androidx.startup.StartupException: androidx.startup.StartupException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/APPLICATION.PACKAGE.DA-xirhmP3vZLsbo3R-t6vbKA==/base.apk"],nativeLibraryDirectories=[/data/app/APPLICATION.PACKAGE.DA-xirhmP3vZLsbo3R-t6vbKA==/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libmapbox-common.so" at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:187) at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:173) at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:238) at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:206) at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:45) at android.content.ContentProvider.attachInfo(ContentProvider.java:1917) at android.content.ContentProvider.attachInfo(ContentProvider.java:1892) at android.app.ActivityThread.installProvider(ActivityThread.java:6239) at android.app.ActivityThread.installContentProviders(ActivityThread.java:5805) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5722) at android.app.ActivityThread.-wrap1() at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) Caused by androidx.startup.StartupException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/APPLICATION.PACKAGE.DA-xirhmP3vZLsbo3R-t6vbKA==/base.apk"],nativeLibraryDirectories=[/data/app/APPLICATION.PACKAGE.DA-xirhmP3vZLsbo3R-t6vbKA==/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libmapbox-common.so" at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:187) at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:173) at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:173) at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:238) at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:206) at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:45) at android.content.ContentProvider.attachInfo(ContentProvider.java:1917) at android.content.ContentProvider.attachInfo(ContentProvider.java:1892) at android.app.ActivityThread.installProvider(ActivityThread.java:6239) at android.app.ActivityThread.installContentProviders(ActivityThread.java:5805) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5722) at android.app.ActivityThread.-wrap1() at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) Caused by java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/APPLICATION.PACKAGE.DA-xirhmP3vZLsbo3R-t6vbKA==/base.apk"],nativeLibraryDirectories=[/data/app/APPLICATION.PACKAGE.DA-xirhmP3vZLsbo3R-t6vbKA==/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libmapbox-common.so" at java.lang.Runtime.loadLibrary0(Runtime.java:1011) at java.lang.System.loadLibrary(System.java:1657) at com.mapbox.common.loader.MapboxLibraryLoader.load(MapboxLibraryLoader.kt:19) at com.mapbox.common.CoreInitializer.create(CoreInitializer.kt:65) at com.mapbox.common.CoreInitializer.create(CoreInitializer.kt:8) at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:180) at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:173) at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:173) at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:238) at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:206) at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:45) at android.content.ContentProvider.attachInfo(ContentProvider.java:1917) at android.content.ContentProvider.attachInfo(ContentProvider.java:1892) at android.app.ActivityThread.installProvider(ActivityThread.java:6239) at android.app.ActivityThread.installContentProviders(ActivityThread.java:5805) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5722) at android.app.ActivityThread.-wrap1() at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) ```
AndroidPat commented 1 year ago

Same problem. We have this in the manifest:

        <!-- This allows us to use Hilt with WorkManager
         https://developer.android.com/guide/background/persistent/configuration/custom-configuration#remove-default
         -->
        <provider
            android:name="androidx.startup.InitializationProvider"
            android:authorities="${applicationId}.androidx-startup"
            android:exported="false"
            tools:node="merge">
            <meta-data
                android:name="androidx.work.WorkManagerInitializer"
                android:value="androidx.startup"
                tools:node="remove" />

So far reported from Google Pixels on Android 10

Fatal Exception: java.lang.RuntimeException: Unable to get provider androidx.startup.InitializationProvider: androidx.fragment.app.w: androidx.fragment.app.w: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.metricell.surveyor.network.internet.speedtest-rGt55HNh3fn-qFqkxtzifQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.metricell.surveyor.network.internet.speedtest-rGt55HNh3fn-qFqkxtzifQ==/lib/arm64, /system/lib64, /system/product/lib64]]] couldn't find "libmapbox-common.so" at android.app.ActivityThread.installProvider(ActivityThread.java:6988) at android.app.ActivityThread.installContentProviders(ActivityThread.java:6528) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6445) at android.app.ActivityThread.access$1300(ActivityThread.java:219) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1859) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

PavlosTze commented 1 year ago

Still happening, any news?

felixkrautschuk commented 1 year ago

The same issue is occurring on my side using Mapbox Android SDK 11.0.0-beta.3 (and also beta.2). However everything is working as expected when using beta.1.

Log:

FATAL EXCEPTION: main Process: de.maxity.mapbox.demo, PID: 8166 java.lang.RuntimeException: Unable to get provider androidx.startup.InitializationProvider: androidx.startup.StartupException: androidx.startup.StartupException: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "emutls_get_address" referenced by "/data/app/~~p9KGFhN8eM71LhLks11adw==/de.maxity.mapbox.demo-b8wpWXy-Khe8eYEA6a-f2w==/lib/x86_64/libmapbox-common.so"... at android.app.ActivityThread.installProvider(ActivityThread.java:7467) at android.app.ActivityThread.installContentProviders(ActivityThread.java:6973) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6744) at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2133) 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:7872) 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:936) Caused by: androidx.startup.StartupException: androidx.startup.StartupException: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__emutls_get_address" referenced by "/data/app/~~p9KGFhN8eM71LhLks11adw==/de.maxity.mapbox.demo-b8wpWXy-Khe8eYEA6a-f2w==/lib/x86_64/libmapbox-common.so"... at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:187) at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:238) at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:206) at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:45) at android.content.ContentProvider.attachInfo(ContentProvider.java:2451) at android.content.ContentProvider.attachInfo(ContentProvider.java:2421) at android.app.ActivityThread.installProvider(ActivityThread.java:7462) at android.app.ActivityThread.installContentProviders(ActivityThread.java:6973)  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6744)  at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2133)  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:7872)  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:936)  Caused by: androidx.startup.StartupException: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "emutls_get_address" referenced by "/data/app/~~p9KGFhN8eM71LhLks11adw==/de.maxity.mapbox.demo-b8wpWXy-Khe8eYEA6a-f2w==/lib/x86_64/libmapbox-common.so"... at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:187) at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:173) at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:238)  at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:206)  at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:45)  at android.content.ContentProvider.attachInfo(ContentProvider.java:2451)  at android.content.ContentProvider.attachInfo(ContentProvider.java:2421)  at android.app.ActivityThread.installProvider(ActivityThread.java:7462)  at android.app.ActivityThread.installContentProviders(ActivityThread.java:6973)  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6744)  at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2133)  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:7872)  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:936)  Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__emutls_get_address" referenced by "/data/app/~~p9KGFhN8eM71LhLks11adw==/de.maxity.mapbox.demo-b8wpWXy-Khe8eYEA6a-f2w==/lib/x86_64/libmapbox-common.so"... at java.lang.Runtime.loadLibrary0(Runtime.java:1077) at java.lang.Runtime.loadLibrary0(Runtime.java:998) at java.lang.System.loadLibrary(System.java:1661) at com.mapbox.common.loader.MapboxLibraryLoader.load(MapboxLibraryLoader.kt:19) at com.mapbox.common.CoreInitializer.create(CoreInitializer.kt:98) at com.mapbox.common.CoreInitializer.create(CoreInitializer.kt:12) at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:180) at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:173)  at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:238)  at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:206)  at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:45)  at android.content.ContentProvider.attachInfo(ContentProvider.java:2451)  at android.content.ContentProvider.attachInfo(ContentProvider.java:2421)  at android.app.ActivityThread.installProvider(ActivityThread.java:7462)  at android.app.ActivityThread.installContentProviders(ActivityThread.java:6973)  at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6744)  at android.app.ActivityThread.-$$Nest$mhandleBindApplication(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2133)  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:7872)  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:936) 

felixkrautschuk commented 11 months ago

still exists in 11.0.0-rc.2 (last working version: 11.0.0-beta.1)

kiryldz commented 11 months ago

Closing as duplicate of https://github.com/mapbox/mapbox-maps-android/issues/1109, please consider this workaround for v10 for now. Proper fix for v10 / v11 will be landing later.