Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sporadic MapboxInitializerException/ExceptionInInitializerError on MapBox library loading #2364

Closed
romanYND opened this issue May 6, 2024 · 1 comment
Labels
bug 🪲 Something isn't working

Comments

@romanYND
Copy link

romanYND commented May 6, 2024

Environment

  • Android OS version: Android 9, Android 11
  • Devices affected: 85% Google, 15% OnePlus
  • Maps SDK Version: 11.2.0

Observed behavior and steps to reproduce

Sporadic crashes reported via Crashlytics when loading Mapbox libraries.
Previously some of the users were experiencing this closed issue: #1109, unfortunately the fix in the recent releases did not work.
I have checked the existence of .so libraries in the intermediates, as well as in the APK/AAB, they are present for all architectures (both libmapbox-common.so and libmapbox-maps.so present in arm64-v8a, armeabi-v7a, x86, x86_64).

Expected behavior

No crashes.

Notes / preliminary analysis

Additional links and references

Stacktrace:

Fatal Exception: java.lang.ExceptionInInitializerError:
       at com.mapbox.common.MapboxOptionsImpl.setAccessToken(MapboxOptionsImpl.java)
       at com.mapbox.common.MapboxOptions.setAccessToken(MapboxOptions.kt:23)
       at com._redacted_.android.Application.initMapbox(Application.kt:66)
       at com._redacted_.android.Application.onCreate(Application.kt:39)
       at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1194)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6735)
       at android.app.ActivityThread.access$1300(ActivityThread.java:239)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1915)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:223)
       at android.app.ActivityThread.main(ActivityThread.java:7680)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:423)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Caused by com.mapbox.common.MapboxInitializerException: Failed to initialize: Attempt=3, exception=[StartupException], initializer called 71 ms ago, exception.message=[androidx.startup.StartupException: java.lang.UnsatisfiedLinkError: dlopen failed: library "libmapbox-common.so" not found], exception.cause=[StartupException], exception.cause.message=[java.lang.UnsatisfiedLinkError: dlopen failed: library "libmapbox-common.so" not found], extractedNativeLibs=[], isInstantApp=[false], isMainThread=[true]
       at com.mapbox.common.BaseMapboxInitializer$Companion.runCatchingEnhanced(BaseMapboxInitializer.kt:304)
       at com.mapbox.common.BaseMapboxInitializer$Companion.init(BaseMapboxInitializer.kt:209)
       at com.mapbox.common.BaseMapboxInitializer$Companion.init(BaseMapboxInitializer.kt:113)
       at com.mapbox.common.BaseMapboxInitializer.init(BaseMapboxInitializer.kt:2)
       at com.mapbox.common.MapboxOptionsImpl.<clinit>(MapboxOptionsImpl.java:50)
       at com.mapbox.common.MapboxOptionsImpl.setAccessToken(MapboxOptionsImpl.java)
       at com.mapbox.common.MapboxOptions.setAccessToken(MapboxOptions.kt:23)
       at com._redacted_.android.Application.initMapbox(Application.kt:66)
       at com._redacted_.android.Application.onCreate(Application.kt:39)
       at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1194)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6735)
       at android.app.ActivityThread.access$1300(ActivityThread.java:239)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1915)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:223)
       at android.app.ActivityThread.main(ActivityThread.java:7680)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:423)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Caused by androidx.startup.StartupException: androidx.startup.StartupException: java.lang.UnsatisfiedLinkError: dlopen failed: library "libmapbox-common.so" not found
       at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:187)
       at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:138)
       at androidx.startup.AppInitializer.initializeComponent(AppInitializer.java:117)
       at com.mapbox.common.BaseMapboxInitializer$Companion.init(BaseMapboxInitializer.kt:240)
       at com.mapbox.common.BaseMapboxInitializer$Companion.init(BaseMapboxInitializer.kt:113)
       at com.mapbox.common.BaseMapboxInitializer.init(BaseMapboxInitializer.kt:2)
       at com.mapbox.common.MapboxOptionsImpl.<clinit>(MapboxOptionsImpl.java:50)
       at com.mapbox.common.MapboxOptionsImpl.setAccessToken(MapboxOptionsImpl.java)
       at com.mapbox.common.MapboxOptions.setAccessToken(MapboxOptions.kt:23)
       at com._redacted_.android.Application.initMapbox(Application.kt:66)
       at com._redacted_.android.Application.onCreate(Application.kt:39)
       at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1194)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6735)
       at android.app.ActivityThread.access$1300(ActivityThread.java:239)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1915)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:223)
       at android.app.ActivityThread.main(ActivityThread.java:7680)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:423)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Caused by androidx.startup.StartupException: java.lang.UnsatisfiedLinkError: dlopen failed: library "libmapbox-common.so" not found
       at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:187)
       at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:173)
       at androidx.startup.AppInitializer.doInitialize(AppInitializer.java:138)
       at androidx.startup.AppInitializer.initializeComponent(AppInitializer.java:117)
       at com.mapbox.common.BaseMapboxInitializer$Companion.init(BaseMapboxInitializer.kt:240)
       at com.mapbox.common.BaseMapboxInitializer$Companion.init(BaseMapboxInitializer.kt:113)
       at com.mapbox.common.BaseMapboxInitializer.init(BaseMapboxInitializer.kt:2)
       at com.mapbox.common.MapboxOptionsImpl.<clinit>(MapboxOptionsImpl.java:50)
       at com.mapbox.common.MapboxOptionsImpl.setAccessToken(MapboxOptionsImpl.java)
       at com.mapbox.common.MapboxOptions.setAccessToken(MapboxOptions.kt:23)
       at com._redacted_.android.Application.initMapbox(Application.kt:66)
       at com._redacted_.android.Application.onCreate(Application.kt:39)
       at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1194)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6735)
       at android.app.ActivityThread.access$1300(ActivityThread.java:239)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1915)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:223)
       at android.app.ActivityThread.main(ActivityThread.java:7680)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:423)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Caused by java.lang.UnsatisfiedLinkError: dlopen failed: library "libmapbox-common.so" not found
       at java.lang.Runtime.loadLibrary0(Runtime.java:1093)
       at java.lang.Runtime.loadLibrary0(Runtime.java:1013)
       at java.lang.System.loadLibrary(System.java:1664)
       at com.mapbox.common.loader.MapboxLibraryLoader.load(MapboxLibraryLoader.kt:19)
       at com.mapbox.common.CoreInitializer.create(CoreInitializer.kt:97)
       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.doInitialize(AppInitializer.java:138)
       at androidx.startup.AppInitializer.initializeComponent(AppInitializer.java:117)
       at com.mapbox.common.BaseMapboxInitializer$Companion.init(BaseMapboxInitializer.kt:240)
       at com.mapbox.common.BaseMapboxInitializer$Companion.init(BaseMapboxInitializer.kt:113)
       at com.mapbox.common.BaseMapboxInitializer.init(BaseMapboxInitializer.kt:2)
       at com.mapbox.common.MapboxOptionsImpl.<clinit>(MapboxOptionsImpl.java:50)
       at com.mapbox.common.MapboxOptionsImpl.setAccessToken(MapboxOptionsImpl.java)
       at com.mapbox.common.MapboxOptions.setAccessToken(MapboxOptions.kt:23)
       at com._redacted_.android.Application.initMapbox(Application.kt:66)
       at com._redacted_.android.Application.onCreate(Application.kt:39)
       at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1194)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6735)
       at android.app.ActivityThread.access$1300(ActivityThread.java:239)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1915)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:223)
       at android.app.ActivityThread.main(ActivityThread.java:7680)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:423)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
@romanYND romanYND added the bug 🪲 Something isn't working label May 6, 2024
@kiryldz
Copy link
Contributor

kiryldz commented May 6, 2024

@romanYND please check this detailed comment (section What does the fix not cover).

@kiryldz kiryldz closed this as completed May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants