In my Android project, using the latest Gradle build tools, I have one file with my own C code and a few simple features. The only things that are included in the C file are string.h and jni.h, and the functions just return String and primitives. The file is placed in the jni directory, except for other source folders (java, res, etc.).
When I create the application, it compiles the C code, generates a .so file and includes it in my APK. The problem is that the .so file has ALL characters.
When checking the intermediate .so file placed in build / intermediate / ndk / obj, all characters still exist. So, somewhere after creating the first .so file and when it is packed, everything is devoid.
When creating the .so file using the ndk-build command line, everything works fine and the characters are on.
Is this a bug in the Android Gradle plugin (I'm using the latest version!), Or am I missing something?
android android-studio android-gradle android-ndk jni
Erik hellman
source share