I am having difficulties integrating a native library I have already built using ndk-build
into my Android Studio project. The problem is that I am stuck in a transitional period where the Gradle syntax is brand new, but documentation and online help still reference the old syntax.
My library is in this location on my project: app/libs/(armeabi and others)/libsample.so
, for a total of 7 variants of the same library for different architectures. I also have the header files for this library in app/src/main/jni/headers
, and the C wrapper file which calls functions defined in this library on app/src/main/jni/wrapper.c
. The wrapper file has a #include "headers/sample.h"
.
The main issue is that I don't know how to set up my Gradle build to use the prebuilt shared library. I have a working Android.mk
file which can successfully compile my wrapper to use the shared library, but I can't use it in Android Studio, since Gradle generates it's own makefile and uses that instead. Anyone has any idea how to proceed from here?