0

In my app I'm using Android NDK to build libraries for armeabi-v7a, arm64-v8a, x86, and x86_64 ABI's. I'm uploading the libraries as a bundle to google play.

On some devices I'm getting the following error

Fatal Exception: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/my-package-name-1/base.apk"],nativeLibraryDirectories=[/data/app/my.package.name-1/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libc++_shared.so"

I checked the content of the uploaded bundle and it definitely contains libc++_shared.so for the above mentioned ABIs.

It seems that the directory that is searched is incorrect "../lib/arm". I didn't add support for obsolete ABIs(mips, armeabi), but I don't remember that there was anything called "arm".

How could I fix this issue?

Update: Specifying the supported ABIs explicitly in gradle file didn't help. I again checked if libc++_shared.so is present inside of the bundle file (for each ABI) before uploading it to play store, and again there were no files missing.

Another strange thing I noticed is that there are many crashes per user (+10/user). I find this a bit strange because without the libraries, the app cannot work (not even start). And if I would start an app that immediately crashes or doesn't work at all, I would uninstall it probably after the first unsuccessful try.

Thanks

roman
  • 66
  • 1
  • 7
  • This could be related to https://stackoverflow.com/questions/56982270/android-application-unable-to-create-soflink-to-native-library-for-64-bit-shared . Try doing adb shell and dumpsys package packages | grep your_package_name and check what is your legacyNativeLibraryDir/CPU_ARCH . – Gr8Warrior Jul 19 '19 at 06:59
  • legacyNativeLibraryDir is just ending with /lib, which seems correct. Anyway, it's not crashing on my devices. Only on devices I don't have access to. – roman Jul 19 '19 at 12:11
  • @roman did you find a proper solution? – fillobotto Apr 01 '21 at 08:35

1 Answers1

1

Check if you jni builds are being copied to libs instead of jniLibs. if yes, copy content from libs to jniLibs.

Check out this post

Gr8Warrior
  • 699
  • 7
  • 11
  • I noticed that when I enable Firebase Crashlytic and I don't specify the target native ABIs explicitly in gradle `(ndk { abiFilters ..})`, the buildsystem creates `armeabi` folder that only contains `libcrashlytics.so` and not my other libraries. Can "../lib/arm" directory be actually used for `armeabi`? Will have to monitor this for some time to see if I get crashes after my last changes where I specified the exact ABIs in gradle. Thanks for your suggestions – roman Jul 19 '19 at 12:22