2

I'm working on an Android Project and I need to add a (.jar) library awesomework.jar .

When I add the library and run the project in my Android device I receive the below error.

java.lang.UnsatisfiedLinkError: dlopen failed: library "/system/lib64/libDecodeApi.so" needed or dlopened by "/system/lib64/anotherlib.so" is not accessible for the namespace "classloader-namespace"

The program crash inside my awesomework.jar in line System.loadLibrary("DecodeApi");

My setup:

  • Android OS Version: 10
  • minSdkVersion: 18
  • targetSdkVersion: 18

What I search for

  1. Reading this answer, I tried to set main.jniLibs.srcDirs = ['libs'] in build.gradle. This doesn't work because when I pull off the libDecodeApi.so from android device, the error came again searching for another .so file in /system/ directory like libc++.so and many others. So I understand that pulling off almost all necessary shared objects from /system directory is not the solution.

  2. I found that all needed libraries are also under the /vendor directory. I' m not quite sure but due to my targetSdkVersion and my Android OS Version should my awesomework.jar search for those shared objects under /verdor directory which is valid(?) for my Android OS?

  3. Is something that can I do outside the awesomework.jar and force my library to search in /vendor directory? I don't have access to awesomework.jar source files.

  4. If I had access to awesomework.jar source files (searching in more academic level now), is it acceptable to add the full path to System.loadLibrary(); in order to force it search in /vendor dir? Something like that System.loadLibrary("vendor/lib64/DecodeApi");. I saw this answer providing a path in project dir.

Any other thoughts, how to approach this problem and find a solution?

yannisalexiou
  • 605
  • 12
  • 25

0 Answers0