Fatal Exception: java.lang.UnsatisfiedLinkError couldn't find lib.so

Viewed 1044

Recently Crashlytics has reported a crash from a HTC One A9 Android 7.0 device for an app that I'm working on.

Fatal Exception: java.lang.UnsatisfiedLinkError  nativeLibraryDirectories=[/data/app/com.app.test-1/lib/arm64, /system/lib64, /vendor/lib64]]] couldn't find lib.so

I looked everywhere specially similar questions but could not find a proper solution to my case because the app supports 64 bit version of the native library too. (See cmake config below)

This is the first time that someone with this device has installed the app and I did not see any linkage error on any other devices before.

I'm actually not sure if it is looking for the native-lib in the mentioned paths in the posted error? If that's the case, why it does't look for the lib in the lib/arm64-v8a path based on my abiFilters?

Here is my cmake config inside the app gradle:

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

How can this issue be solved?

1 Answers

First off: If it is one crash incident, I wouldn't worry about it. Only if multiple users crash on it, I would prioritize it. Freak errors on Android happen, especially if you consider the quality of some of the devices.

I do not think it is a missing library on your end.

The actual problem is the really strange library name: lib.so

This is not a valid name you would expect in an Android NDK application. You always expect it to look for libxxx.so

The fact that it does not, means that the library name got mangled, or not properly specified in the manifest file.

Look in AndroidManifest.xml inside the activity tag, for a line like this:

<meta-data android:name="android.app.lib_name" android:value="xxx" />

Next, in your apk file, you will want to see the library listed as such:

lib/arm64-v8a/libxxx.so
lib/armeabi-v7a/libxxx.so

With xxx, as your app name, of course.

If the entries in APK or AndroidManifest are missing, the fault is on your end. If they are there, I would just suspect a bogus customer device, maybe suffering from running out of file storage, or something.

Related