-
Notifications
You must be signed in to change notification settings - Fork 136
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 crashes when Mapbox library is loaded: java.lang.UnsatisfiedLinkError at com.mapbox.common.loader.MapboxLibraryLoader.load #1109
Comments
Seems it's the same issue with library loading as mapbox/mapbox-gl-native-android#416 |
We've started to get this exception lately as well. Here are the details, I hope it helps:
So far we faced this issue on 2 devices repeatedly:
Dependency details:
|
Also spiking for us now rapidly from today on:
~80% of that crash are on Android 11 where 80% is Samsung Galaxy A12 atm. We use mapbox |
We're getting the same error and we use mapbox |
Still an issue at |
@alingocab Have you released an app with crashlytics 18.3.0 (or higher) recently? |
@jush I'm using com.google.firebase:firebase-bom:31.2.1. As I can see, firebase-bom:31.2.1 is using crashlytics 18.3.5. |
Thanks, Crashlytics release 18.3.0 introduced this change that might explain why you see it more often:
|
I will attach full crash details from Firebase. |
Same issue here as well. Crash log looks just like the one posted by alingocab as well as the OP. |
Same issue here as well after the v9 ->v10 migration, currently on v10.11.1 |
Same issue here, current version 10.8.0 |
i have the same problem |
Same here. Has there been any resolution? |
Update mabox sdk to 10.12.0 today, issue still present, a lot of crashes coming up. Seems like this crash is not important for mapbox team... |
Also seeing this issue since using Crashlytics 18.3.0+, but I have not physically seen the crash myself, nor have I received a "startup crash" report from our beta testers or Play Store users. Perhaps it is either a 'silent' crash, or happens only once per user and they assume nothing of it? |
I have the same crash with device Nexus 5X 8.1.0 while Mapbox Android is 10.12.0 |
For me this is the same: while there are only 3 users having this crash, they're all on a Nexus 5x with Android 8.1.0 |
The reason you see Nexus 5x is because that's a device used by Google to run some tests on your app before pushing it to Google Play. In my case, beside this Nexus 5x I see a lot of other devices owned by real users. |
It's interesting. But there are also some crashes on the Galaxy devices. |
Could you please check if following helps? |
There is similar issue in mapbox/mapbox-android-demo#1280 we can add these config into
|
@jush Do you have an estimate date for this fix to hit the stable version? |
Thanks for trying to resolve it. It's a #1 crash in our app. I've tried pulling 10.16.2-SNAPSHOT.1115T1113Z.912f916 but I get 403 forbidden error. The version 10.16.2 pulls fine. |
@AndroidPat |
Thank you, I missed this bit! to Could not HEAD 'https://mvnrepository.com/artifact/com.github.gundy/semver4j/com/mapbox/base/common/0.8.0/common-0.8.0.pom'. Received status code 403 from server: Forbidden |
@AndroidPat please add the new mirror and do not replace it. Your gradle file should look somehow like:
|
https://gist.github.com/AndroidPat/173e70244bf05c386745bdd70398ec9c |
The fix with the same limitations regarding Mapbox Navigation SDK and Mapbox Search SDK as was described in #1109 (comment) has been included in https://github.com/mapbox/mapbox-maps-android/releases/tag/v10.16.3. We will continue on pushing the fix to Maps v11 / Navigation / Search to fully eliminate the issue across all the Mapbox Android SDKs and post updates here. |
Hey folks 🖖 We are planning to test the new 10.16.3 version to resolve the crash. But we are using the nav sdk for some of our applications https://github.com/mapbox/mapbox-navigation-android/releases/tag/v2.17.2 In the release notes for the version it mentions that if we use nav sdk, we might still face the crash. And in the nav sdk release notes it mentions the version is tested with an earlier version. I have 2 questions to clear some confusions we have.
Thank you for providing a fix for this issue. It's been a long time that we had this as a top crash 🚀 |
Hey @oguzcelik!
You will most likely see another crash saying that another (navigation related and not common described in this issue)
No clear estimations for now sadly. As soon as we have details we will share them here. The high level plan is to actually have the fix in Maps v11 first thing and then focus on updating Nav / Search SDKs. |
I just tred out the latest version com.mapbox.maps:android:11.2.0-beta.1
|
@felixkrautschuk Hi, this seems slightly different issue. This is not that the native library is completely missing in the device but rather that Most likely you're mixing different Mapbox SDKs (e.g., Maps SDK with Search SDK, or Navigation SDK) versions and that causes some issues for commonly shared code among those. Could you please share more details about:
Actually, might be even better to open a new ticket. Thanks! |
Hey all, Mapbox has implemented better way of initialization and it's available both for Maps v10 / v11 and Nav v2 / v3. Here's the list of actual versions where this is implemented:
What does the fix coverThis means that exception described in this ticket happening on startup (as we're using AndroidX initializers in SDK) should not happen anymore. However we did not find the actual root cause why the native libraries might be missing on startup, it seems to be the Android App Bundle implementation which is out of our control. So the initialization workflow now works the following way:
Summing up: the What does the fix not coverAs said above we did not find the actual reason why the native libraries might not be in place. So it's absolutely possible that even if we gracefully catch the exception for you on startup and do not crash - the libraries might still be not there when you first access the Mapbox APIs. The most obvious use-case for that is accessing some Mapbox APIs in your If the native libraries could not be loaded right before Mapbox function - our SDK could not work. However with that new approach it's still possible to recover in this situation but that will require adding code in your end applications based on the business logic you want to apply. Example: You have an app that uses App Bundle and even after upgrading to latest version with a fix you see crashes (hopefully reduced amount). Looking into your code you realize that the
In that case you could apply the following approach:
ConclusionWe hope that the fix will work well for you. I am closing this ticket (as it's already way too huge) but please feel free to open new issues (also note that we greatly enhanced the underlying exception so it contains additional data that might help us to proceed even further hopefully in fully eliminating this in SDK). As an example there was already an issue related to new approach and connected with accessing Mapbox API inside user's initializers. |
@kiryldz But we cannot upgrade Mapbox because of this. |
@PavlosTze the issue you shared is different from the one in this thread. I added some notes on your issue for anyone who's poking around. This issue is for For anyone getting the error from this thread the best trouble shooting steps will be:
Some useful shell commands, run from your project directory.
You should see some mapbox shared objects in your build intermediates. Additionally you can unpack your applications APK file to look for the shared objects as well.
You should see an entries for a mapbox initializer; if it's omitted then there's something about your app's android manifest that's overriding the SDK's manifest to run the initializer; which loads the shared objects. This also should be in the APK as well. |
@dudeuter I ran
But we still get the following crash in our users (on Nexus 5X) in that version:
|
@PavlosTze can you confirm that you have the initializer as well? Lastly you can repeat the step above by unpacking your apk as well. If everything there still exists then it's likely a conflict with how you have Multidexing configured; which is more of an Android issue that a Mapbox issue. |
@dudeuter I confirm that we have the initializer and we have the libraries in the APK as well, everything is there. We don't have Multidexing configured, and these crashes did not take place for years until since the version mentioned in this issue. |
The issue seems to be still happening with the following versions:
Any chance this could be reopened? |
@kiryldz unfortunately I have no clear evidence of why this is also affecting our code. I'll share the traces in case it gives someone a hint:
Down the trace in Crashlytics I see the following as well:
In our
|
Environment
Observed behavior and steps to reproduce
Sporadic crashes reported via crashlytics when loading Mapbox libraries.
Expected behavior
No crashes.
Notes / preliminary analysis
Additional links and references
Stack trace
The text was updated successfully, but these errors were encountered: