Android error -- No implementation found for native Lcomd, error -- nolcomd
No implementation found for native Lcom errors occurred during Cpp compilation and running using NDK. After debugging for a long time, it was discovered that
XXX. h and XXX. cpp. In XXX. cpp # include XXX. h, No implementation found for native Lcom exists.
Then, XXX. h is deleted, all of which are implemented in XXX. cpp and are passed.
NDK cannot include the XXX. h compiled by javah directly. To include at least some statements. Of course, you can include other. H files.
/* DO NOT EDIT THIS FILE - it is machine generated */#include <jni.h>/* Header for class com_ndk_test_JniClient *///#ifndef _Included_com_ndk_test_JniClient//#define _Included_com_ndk_test_JniClient#ifdef __cplusplusextern "C" {#endif/* * Class: com_ndk_test_JniClient * Method: AddStr * Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; */JNIEXPORT jstring JNICALL Java_com_ndk_test_JniClient_AddStr (JNIEnv *, jclass, jstring, jstring);/* * Class: com_ndk_test_JniClient * Method: AddInt * Signature: (II)I */JNIEXPORT jint JNICALL Java_com_ndk_test_JniClient_AddInt (JNIEnv *, jclass, jint, jint);#ifdef __cplusplus}#endif//#endif
#include "com_ndk_test_JniClient.h"#include <stdlib.h>#include <stdio.h>#ifdef __cplusplus extern "C" { #endif /* * Class: com_ndk_test_JniClient * Method: AddStr * Signature: (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; */JNIEXPORT jstring JNICALL Java_com_ndk_test_JniClient_AddStr (JNIEnv *env, jclass arg, jstring instringA, jstring instringB){ jstring str = (*env)->NewStringUTF(env, "HelloWorld from JNI !"); return str; }/** Class: com_ndk_test_JniClient* Method: AddInt* Signature: (II)I*/JNIEXPORT jint JNICALL Java_com_ndk_test_JniClient_AddInt (JNIEnv *env, jclass arg, jint a, jint b){ return a + b;}#ifdef __cplusplus } #endif
After I have compiled a so library and load it in the program, an error will be reported when the native method nativeCreateObject () is called.
The dynamic library is not found,
No implementation found for native Lorg/cocos2dx/lib/Cocos2dxHelper; nativesetapkpath
Does org. cocos2dx. lib. Cocos2dxHelper. java exist in the src directory? Or you can reference the external cocos2dx library.