Search code examples
androidandroid-ndkjava-native-interfaceshared-librariesunsatisfiedlinkerror

UnsatisfiedLinkError when calling native function


I can succesfully load native library with System.loadLibrary(""), but when I call native method from that library, I receive UnsatisfiedLinkError, no implementation found for that method.

But this code works in another application, somehow in mine not.


Solution

  • Did you change the packageName in the jni method, it should be Java_com_example_yourapp_methodname(JNIEnv * env, jobject thiz) where com_example_yourapp is the reference to your package of the class you call the method. and after that, did you call ndk-build again?