Unable to refer Kotlin data class field in JNI

All we need is a simple explanation of the problem, which is provided below. I have a JNI code that intends to modify a field value present in a data class. I’m unable to reference the data class method to do so. Any help is deeply appreciated. data class User(val name: String, val age: Int, … Read more

Android ndk runtime – cannot locate symbol OPENSSL_init_ssl

All we need is a simple explanation of the problem, which is provided below. I crosscompiled openssl 1.1.1g and i crosscompiled libcurl including the openssl. Crosscompilation went trough without a problem, no linker errors on libcurl nothing. Then i included these two openssl and libcurl into my application where again no linking errors. But runtime … Read more

Unable to get a jstring from R.string.* via JNI in a native C application

All we need is a simple explanation of the problem, which is provided below. I’m working on a native c/c++ app, that uses string resources via the strings.xml file. Attempting to use AAssetManager to load the "strings.xml" file, has no effect. Returns the same error I’ve tried looking for various other implementations, but none have … Read more

cargo ndk fails due to pkg-config issue

All we need is a simple explanation of the problem, which is provided below. I think I’ve read every suggestion on the internet at this point to no avail, so I’m hoping I can get some help here. Repro git clone https://github.com/banool/aclip.git cd aclip/frontend/native cargo ndk -t armeabi-v7a -o ../android/app/src/main/jniLibs build The code in question: … Read more

Add pre-built NDK library (.so file) to Android project

All we need is a simple explanation of the problem, which is provided below. I inherited an Android project which includes a sub-project to build a JNI library from C source. I want to remove the C source and include pre-built library instead. Based on tips I found here and there, I copied the .so … Read more

Undefined Function outside Header Error Android NDK

All we need is a simple explanation of the problem, which is provided below. I am currently linking a static library to my Android Project which contains the functions I want to use, the problem that occurs is when I call a function from the static library in Android Project, and the function definition is … Read more