Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Many Fatal Exception: java.lang.UnsatisfiedLinkError #14428

Closed
ben-j69 opened this issue Apr 15, 2019 · 10 comments · Fixed by #14890
Closed

Many Fatal Exception: java.lang.UnsatisfiedLinkError #14428

ben-j69 opened this issue Apr 15, 2019 · 10 comments · Fixed by #14890
Labels
Android Mapbox Maps SDK for Android needs information

Comments

@ben-j69
Copy link

ben-j69 commented Apr 15, 2019

**Android versions:**6.0.1
Device models: Nexus 5X
Mapbox SDK versions:
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:7.2.0'
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-services:4.5.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v7:0.5.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.33.2'
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.33.2'

I have just added crashlytics to my app and I got this new error from the sdk :
No implementation found for void com.mapbox.mapboxsdk.net.NativeConnectivityListener.initialize() (tried Java_com_mapbox_mapboxsdk_net_NativeConnectivityListener_initialize and Java_com_mapbox_mapboxsdk_net_NativeConnectivityListener_initialize__)

com.mapbox.mapboxsdk.net.NativeConnectivityListener.initialize (NativeConnectivityListener.java) com.mapbox.mapboxsdk.net.NativeConnectivityListener. (NativeConnectivityListener.java:27) com.mapbox.mapboxsdk.net.ConnectivityReceiver.instance (ConnectivityReceiver.java:43) com.mapbox.mapboxsdk.Mapbox.getInstance (Mapbox.java:60)

I have several crashes each day on my app and it is affecting my user, we need a solution please.

fail

@ben-j69 ben-j69 changed the title Fatal Exception: java.lang.UnsatisfiedLinkError Many Fatal Exception: java.lang.UnsatisfiedLinkError Apr 16, 2019
@tobrun tobrun added the Android Mapbox Maps SDK for Android label Apr 16, 2019
@tobrun
Copy link
Member

tobrun commented Apr 16, 2019

This could potentially come from mismatching dependency versions.
Below a list of the dependencies that match versions:

implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:7.3.1'
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-services:4.6.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v7:0.6.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.35.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation-ui:0.35.0'

Would you be able to test with this setup?

@ben-j69
Copy link
Author

ben-j69 commented Apr 17, 2019

I will try it but before to go live it will take 2 weeks

@ben-j69
Copy link
Author

ben-j69 commented May 2, 2019

Hello @tobrun

I use your configuration and now I have this error

com.getkeepsafe.relinker.ApkLibraryInstaller.installLibrary (ApkLibraryInstaller.java:128) com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal (ReLinkerInstance.java:180) com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary (ReLinkerInstance.java:136) com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary (ReLinkerInstance.java:92) com.mapbox.mapboxsdk.module.loader.LibraryLoaderProviderImpl$ReLinkerLibraryLoader.load (LibraryLoaderProviderImpl.java:38) com.mapbox.mapboxsdk.LibraryLoader.load (LibraryLoader.java:43) com.mapbox.mapboxsdk.net.NativeConnectivityListener. (NativeConnectivityListener.java:1) com.mapbox.mapboxsdk.net.ConnectivityReceiver.instance (ConnectivityReceiver.java:43) com.mapbox.mapboxsdk.Mapbox.getInstance (Mapbox.java:60)

@ben-j69
Copy link
Author

ben-j69 commented Sep 18, 2019

Hello I still have this error it is not satisfying at all

@tobrun
Copy link
Member

tobrun commented Sep 18, 2019

Are you using any kind of abi split configuration? which packaging format are you using? Are you using any other native libraries yourself or through dependencies? How many percent of users are impacted?

note that you are able to replace the native library loader by any your own choice with LibraryLoader#setLibraryLoader

@ben-j69
Copy link
Author

ben-j69 commented Sep 18, 2019

I don't think I am using any abi split configuration. Do you have more infos ?

I am using app bundles.

I have other native libs like bugsnag for example.

Around 1% of my user have this error, this is the most common error in my app and it is why I really need to fix it.

@caovanthanh203
Copy link

caovanthanh203 commented Feb 13, 2020

@ben-j69
Because Mapbox only has 4 lib folder is:

"armeabi-v7a", "arm64-v8a", "x86", "x86_64"

You can see in APK analyze:
https://i.ibb.co/zXyjwjD/Screenshot-from-2020-02-14-00-31-08.pngScreenshot from 2020-02-14 00-31-08

But some device will find Mapbox class in wrong path, example it find in folder "armeabi", because this folder not exists so UnsatisfiedLinkError will be throw.

Have to solve?
You have to tell to device that it should find Mapbox lib in there folders:

"armeabi-v7a", "arm64-v8a", "x86", "x86_64"

by add filter to build.gradle in app module:

defaultConfig {
       ...
       ndk {
           abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
       }
}

in some case you also have to add this line to file gradle.propertise :

android.useDeprecatedNdk=true

Notes: I see that some device x86 only run well when set to:

ndk {
abiFilters "x86"
}

so I think we should built multi apk abi

@ben-j69
Copy link
Author

ben-j69 commented Feb 26, 2020

On circle CI, updating from mapbox 8.4.0 to version 9.0.0 I had to add

ndk { abiFilters "x86" }

to make it work, thanks.

@GrEg00z
Copy link

GrEg00z commented Jan 26, 2021

I confirm the solution given by @bc67da8d works with this config :
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:6.1.3'

Only needed to add in app.gradle :

ndk {
      abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
  }

My source code is from Nativescript app, with the following conf :

  • Nativescript : 6.2.2
  • tns-core-modules : 6.1.0
  • tns-android : 6.2.0

@Lizzergas
Copy link

I am getting the same error with implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.0.0'

No additional dependencies are used for mapbox.

Previous version worked on 8.0.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android needs information
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants