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.sofrom android device, the error came again searching for another.sofile in/system/directory likelibc++.soand many others. So I understand that pulling off almost all necessary shared objects from/systemdirectory is not the solution.I found that all needed libraries are also under the
/vendordirectory. I' m not quite sure but due to mytargetSdkVersionand my Android OS Version should myawesomework.jarsearch for those shared objects under/verdordirectory which is valid(?) for my Android OS?Is something that can I do outside the
awesomework.jarand force my library to search in/vendordirectory? I don't have access toawesomework.jarsource files.If I had access to
awesomework.jarsource files (searching in more academic level now), is it acceptable to add the full path toSystem.loadLibrary();in order to force it search in/vendordir? 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?