I'm working with an app that implements a library which use 2 files .so.
So the photo is:
APP --> LIBRARY
inside LIBRARY I have a folder called jniLibs at the same level of "java" or "res", with 2 subfolders storing a lib.so.
APP
|
---LIBRARY
|
--- java
--- res
--- jniLibs
|
--- arm64-v8a ----> lib.so
--- armeabi-v7a --> lib.so
I'm trying to get this path with:
private val path = "${context.applicationInfo.nativeLibraryDir}/lib.so"
but when I run the app and call the library, it's returns me an IOException because the path doesn't exist.
java.io.IOException: Cannot run program "/data/app/~~UKA0xfuymw9X6WLqOTKpgQ==/es.test.testingapp-SYQbmzLkH63ebcNwAoJskg==/lib/arm64/lib.so" (in directory "/data/user/0/es.test.testingapp/files"): error=2, No such file or directory
How I can get this to work, I think that the problem is that with the context of the app the folder is in another location but I don't know how to solve it.
My library is created separate, with com.android.library, and I'm adding to the project of the main app with an Implementation in build.gradle and settings.gradle.
Thank you