的UnsatisfiedLinkError调用本地函数时 [英] UnsatisfiedLinkError when calling native function
问题描述
我能成功地加载本地库与的System.loadLibrary()
,但是当我调用本地方法从库中,我收到的UnsatisfiedLinkError
,没有实现发现该方法。
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.
但是,这code在其他应用程序的工作,不知何故在我没有。
But this code works in another application, somehow in mine not.
推荐答案
你更改JNI方法的packageName,它应该是 Java_com_example_yourapp_methodname(JNIEnv的* ENV,jobject THIZ)
,其中com_example_yourapp是关于你调用方法的类的包。
而在这之后,你叫 NDK的构建
一遍吗?
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?
这篇关于的UnsatisfiedLinkError调用本地函数时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!