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
Reading this answer, I tried to set
main.jniLibs.srcDirs = ['libs']
inbuild.gradle
. This doesn't work because when I pull off thelibDecodeApi.so
from android device, the error came again searching for another.so
file in/system/
directory likelibc++.so
and many others. So I understand that pulling off almost all necessary shared objects from/system
directory is not the solution.I found that all needed libraries are also under the
/vendor
directory. I' m not quite sure but due to mytargetSdkVersion
and my Android OS Version should myawesomework.jar
search for those shared objects under/verdor
directory which is valid(?) for my Android OS?Is something that can I do outside the
awesomework.jar
and force my library to search in/vendor
directory? I don't have access toawesomework.jar
source files.If I had access to
awesomework.jar
source files (searching in more academic level now), is it acceptable to add the full path toSystem.loadLibrary();
in order to force it search in/vendor
dir? Something like thatSystem.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?