Android error--no implementation found for native LCOMD

Source: Internet
Author: User

When using the NDK to compile CPP execution, there are no implementation found for native lcom and other errors, debugging for a long time, only to find

XXX.h and XXX.cpp. In XXX.cpp # # # XXX.h. Unexpectedly appeared No implementation found for native lcom.

Then, XXX.h Delete. All realized in the XXX.cpp, incredibly passed.

NDK is not a direct include compilation (Javah) out of the XXX.h. Suppose you really want to include at least some of the statements to be truncated.

Of course, you can include other. h files.

/* Don't EDIT this file-it are 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



Android error--no implementation found for native LCOMD

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.