I generate a .so file during my build and add it in the right place inside 'jnilibs' folder but I am facing an error stating "Cannot find the native function implementation with Unsatisfied Link Error"
// This is my .kt file
import abc.def.xyz
class MainActivity : Activity () {
public external fun MyNativeFunction() : Boolean
override
fun onCreate (pSavedInstance : Bundle?)
{
super.onCreate (pSavedInstance)
// Calling my Native function
val check = MyNativeFunction ()
}
}
// This is my .cpp file
extern "C" JNIEXPORT jboolean JNICALL
Java_abc_def_xyz_MainActivity_MyNativeFunction () noexcept
{
// .... some code written here
return true;
}
It's not able to find the function's implementation 'MyNativefunction'. Even the signature is correct but couldn't find where I am going wrong.
When I tried to extract the symbols from my generated .so file I was not able to see the this function inside the .so file. Can somebody tell me where I am going wrong?
Help would be appreciated.