6

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
  • Were you able to find solution for this issue ? We have similar issue on Galaxy J Core device only Commented Sep 23, 2020 at 9:45

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

4 Comments

Oh thanks @Bram. Sorry about the misleading name! The name was actually libsomething as you mentioned. I changed the name to lib when I was hiding the credentials before posting here
Do you have four .so files listed in your APK? You can examine the contents on an APK with 'unzip -l' or AndroidStudio.
Well, about the bogus customer device, as reported by Crashlytics, there were a lot of space left off on the device .A lot more than I needed. You're probably right about the ignoring the issue. Right now I'm waiting to see if that is being reported again or not
For the created .apk of AndroidStudio yes. There are four libs. But I've uploaded a Bundle to google play so its theirs responsibility to package only the needed lib for that particular device

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.