Android Studio JNI Module Couldn't find "libnative-lib.so"

Viewed 2764

I have a regular android project. I want to reference another module that is composed of a Simple Object (.so) and a cpp jni file. I created a module and added it to my project. I have a cmakefile and reference it from my gradle project.

When I include the SO and cpp file directly into the main project it works fine. I followed this tutorial essentially Add C++ to Anrdoid

now I want to reference my C++ .so libraries from a different module indirectly from the main application class. Everything builds and compiles but I am getting the following error.

nativeLibraryDirectories=[/data/app/com.example.jniapp01.jniapp01-2/lib/x86, /vendor/lib, /system/lib]]] couldn't find "libnative-lib.so"

I feel there is a copy step that puts the so in the proper location when running on the emulator or in the apk etc... but I dont know where or how to set it. Or do I need to set the environment variable for the ".so" when the app runs?

Any advice. I have been poking at this for too long....

Android Studio 2.3.3 Gradle 2.3.3

UPDATE: I did not specifically resolve this. However, I believe this was related to specific naming convention for the intermediary class that references the native libraries from the java code. I had so many libraries and methods that hand coding was taking a lot of time. I believe there is a way that this can automatically be created from an existing ".so" lib but I was trying to take it from another sample project. more info here may be helpful... here let me know what you think. "The C++ method will also contain your namespace (e.g. com.domain.your) and classname (e.g. YourActivity), it will look something like"

0 Answers
Related