No implementation found for native Lcom/dgut/android/MainActivity;.stringFromJNI ()Ljava/lang/String;
如果你确定方法名没有问题,那么就是本帖关键的地方所在了:
---------------com_centerm_util_MES_Nativie.h----------------
#ifdef __cplusplus
extern "C" {
#endif
/*
* Class: com_centerm_util_MES_Nativie
* Method: testMacAddress
* Signature: (Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_com_centerm_util_MES_1Nativie_testMacAddress
(JNIEnv *, jclass, jstring);
#ifdef __cplusplus
}
#endif
---------------implement.cpp----------------
/*
* Class: com_centerm_util_MES_Nativie
* Method: testMacAddress
* Signature: (Ljava/lang/String;)Z
*/
JNIEXPORT jboolean JNICALL Java_com_centerm_util_MES_1Nativie_testMacAddress
(JNIEnv *, jclass, jstring){
}
--------------------------->
如果CPP文件里面的方法注释被删掉的话,so可以编译出来,但是运行时会报:
No implementation found for native Lcom/centerm/util/MES_Native;.testMacAddress (Ljava/lang/String)Z