Android error--No implementation found for native Lcomd

來源:互聯網
上載者:User

標籤:this   not   ati   art   content   data   and   err   instr   

       在利用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檔案。

/* 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



Android error--No implementation found for native Lcomd

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.