Android error--No implementation found for native Lcomd
2014-08-12 15:20
417 查看
在利用NDK编译Cpp运行时,出现了No implementation found for native Lcom等错误,调试好久,才发现
XXX.h和XXX.cpp,在XXX.cpp里#include XXX.h,居然出现了No implementation found for native Lcom。
然后,XXX.h删除,全部在XXX.cpp里实现,竟然通过了。
NDK是不能直接include 编译(javah)出来的XXX.h。如果真要包含至少要删减一些语句。当然,可以include 其他.h文件。
XXX.h和XXX.cpp,在XXX.cpp里#include XXX.h,居然出现了No implementation found for native Lcom。
然后,XXX.h删除,全部在XXX.cpp里实现,竟然通过了。
NDK是不能直接include 编译(javah)出来的XXX.h。如果真要包含至少要删减一些语句。当然,可以include 其他.h文件。
/* 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 __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 *, 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
相关文章推荐
- Android error--No implementation found for native Lcomd
- OpenCV4Android——No implementation found for native Lorg/opencv/core/Mat;.n_Mat ()J
- No implementation found for native ...Android JNI问题
- Android集高德地图报错:No implementation found for long com.autonavi.amap.mapcore.MapCore.nativeNewInstance
- 高德地图-AndroidStadio-No implementation found for long com.autonavi.amap.mapcore.MapCore.nativeNewInsta
- 【转】Android:No implementation found for native
- Can't load library Android:No implementation found for native
- Android 调用.so包时报错:No implementation found for native Lxxx, java.lang.UnsatisfiedLinkError: XXX时的解决办法(转)
- Android:No implementation found for native
- Android:No implementation found for native(转)
- Android 调用.so包时报错:No implementation found for native Lxxx, java.lang.UnsatisfiedLinkError: XXX时的解决办法
- error: Error retrieving parent for item: No resource found that matches the given name 'android:Wind
- error: Error retrieving parent for item: No resource found that matches the given name 'android:Win
- error: No resource identifier found for attribute 'dropDownHorizontalOffset' in package 'android'
- 关于android自定义View时报error: No resource identifier found for attribute ‘XXX’ in package ‘
- error: No resource identifier found for attribute 'backgroud' in package 'android'
- Android 应用出错 error: Error retrieving parent for item: No resource found that matches the的第二种情况
- error: Error retrieving parent for item: No resource found that matches the given name 'android:Them
- Android应用出错 error: Error retrieving parent for item: No resource found that matches the
- No implementation found for native 以及 java.lang.UnsatisfiedLinkError问题解决一例