android 中的 JNI 函数错误
JNI function error in android
我遇到了麻烦:http://imgur.com/hH0q3Tn
我正在使用 VTK 示例代码,但 JNI 不工作,我不知道该怎么办。我编译了所有库,当我在 phone 上试用应用程序时,应用程序停止了。
我能做什么?
静态本机方法的第二个参数应该是 jclass
,而不是 jobject
。
有关详细信息,请参阅 Are native Java methods equivalent to static Java methods?。
Native Method Arguments
The JNI interface pointer is the first argument to native methods. The JNI interface pointer is of type JNIEnv. The second argument differs depending on whether the native method is static or nonstatic. The second argument to a nonstatic native method is a reference to the object. The second argument to a static native method is a reference to its Java class.
我解决了
图书馆的建设是错误的,我按照这个指南http://www.vtk.org/Wiki/VTK/Building/Linux
我遇到了麻烦:http://imgur.com/hH0q3Tn
我正在使用 VTK 示例代码,但 JNI 不工作,我不知道该怎么办。我编译了所有库,当我在 phone 上试用应用程序时,应用程序停止了。
我能做什么?
静态本机方法的第二个参数应该是 jclass
,而不是 jobject
。
有关详细信息,请参阅 Are native Java methods equivalent to static Java methods?。
Native Method Arguments
The JNI interface pointer is the first argument to native methods. The JNI interface pointer is of type JNIEnv. The second argument differs depending on whether the native method is static or nonstatic. The second argument to a nonstatic native method is a reference to the object. The second argument to a static native method is a reference to its Java class.
我解决了
图书馆的建设是错误的,我按照这个指南http://www.vtk.org/Wiki/VTK/Building/Linux