3

My application is having native code so my data directory is having lib directory /data/data/mypackage/lib/libxxx.so

when I remove cache by 'clear cache' button in settings after swipe kill from recent list, sometimes it removes .so files keeping lib directory. (it happens in LG k10 with Android 7.0). It works well on first use before clearing cache while lib folder is having libxxx.so.

I load my lib by following code.

static {
        System.loadLibrary("xxx");
    }

after clearing cache and relaunch of application , it gives following error

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/com.google.android.maps.jar", zip file "/data/app/mypackage-1/base.apk"],nativeLibraryDirectories=[/data/app/mypackage-1/lib/arm, /system/fake-libs, /data/app/mypackage-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]] couldn't find "libxxx.so"

The only option after this error is to reinstall the application as .so files are removed for unknown reason.

What can I do in such case?

Note : mypackage is package name of my app and libxxx.so is native lib. Original names I am hiding for some reasons.

Volodymyr Lashko
  • 656
  • 6
  • 19
MohK
  • 1,873
  • 1
  • 18
  • 29

0 Answers0