在利用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 __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的更多相关文章

  1. Android 调用.so包时报错:No implementation found for native Lxxx, java.lang.UnsatisfiedLinkError: XXX时的解决办法(转)

    问题就是在调用自己同事写的.so包时,怎么也掉不通,程序一直报错退出,错误内容就是: 1 No implementation found for native Lxxx, 2 Java.lang.Un ...

  2. 【React Native错误集】Android error “Could not get BatchedBridge, make sure your bundle is packaged properly” on start of app

    问题1:Android error “Could not get BatchedBridge, make sure your bundle is packaged properly” on start ...

  3. JNI:no implementation found in native...

    一  javah引发的问题 BUG:D/dalvikvm( 1704): Trying to load lib /data/data/com.ulang/lib/libulangaudio.so 0x ...

  4. Unity在Android和iOS中如何调用Native API

    本文主要是对unity中如何在Android和iOS中调用Native API进行介绍. 首先unity支持在C#中调用C++ dll,这样可以在Android和iOS中提供C++接口在unity中调 ...

  5. RDLC An unexpected error occurred while compiling expressions. Native compiler return value: '-1073741511'

    One of my web project, which has a rdlc file using some expressions, was working fine while developi ...

  6. OpenCV4Android——No implementation found for native Lorg/opencv/core/Mat;.n_Mat ()J

    ok 12-17 08:13:10.461: W/dalvikvm(540): No implementation found for native Lorg/opencv/core/Mat;.n_M ...

  7. Android error:No CPU/ABI system image available for this target

    原文:Android error:No CPU/ABI system image available for this target No CPU/ABI system image available ...

  8. Android Error:Could not find lottie.jar

    Android Error:Could not find lottie.jar 今天遇到了一个及其头疼的问题 同事的工程导到我的电脑里却报错,错误是找不到jcenter仓库里的lottie.jar包 ...

  9. Android JNI学习(三)——Java与Native相互调用

    本系列文章如下: Android JNI(一)——NDK与JNI基础 Android JNI学习(二)——实战JNI之“hello world” Android JNI学习(三)——Java与Nati ...

随机推荐

  1. c24--预编译,宏定义(带参数,不带参数)

    // // main.c // 宏定义 #include <stdio.h> void test(); /* 预处理指令:在我们的文件翻译成0和1之前做的操作我们称之为预处理指令,一般以# ...

  2. <% %> in html

    $(document).on('click', '.invoiceNumber', function () { var string = <%= StaticHelper.GetCurrentC ...

  3. 修改android手机文件权限

    修改android手机文件权限 默认情况下,一个应用肯定是读取不了另外一个应用的数据的,因为权限不够.但是我们一定要读,怎么办? 修改我们要读取文件的权限. Android是基于Linux的,所以修改 ...

  4. Truck History --hdoj

    Truck History Time Limit : 4000/2000ms (Java/Other)   Memory Limit : 131072/65536K (Java/Other) Tota ...

  5. java8新特性系列:[1]让你的eclipse支持java8

    package com.anhui.jdk8; /** * 针对eclipse是否支持java8小测试 * MainClass * @author zhongzh * */ public class ...

  6. java网络通信编程

    网络编程就是在两个或两个以上的设备(例如计算机)之间传输数据.程序员所作的事情就是把数据发送到指定的位置,或者接收到指定的数据,这个就是狭义的网络编程范畴.在发送和接收数据时,大部分的程序设计语言都设 ...

  7. LVS十种调度算法介绍

    1.轮叫调度(Round Robin)(简称rr) 轮叫调度(Round Robin Scheduling)算法就是以轮叫的方式依次将请求调度不同的服务器,即每次调度执行i = (i + 1) mod ...

  8. 什么是 HTML5?

    HTML5 是下一代的 HTML. 什么是 HTML5? HTML5 将成为 HTML.XHTML 以及 HTML DOM 的新标准. HTML 的上一个版本诞生于 1999 年.自从那以后,Web ...

  9. Python 实现简单图片验证码登录

    朋友说公司要在测试环境做接口测试,登录时需要传入正确的图片的验证码,本着懒省事的原则,推荐他把测试环境的图片验证码写死,我们公司也是这么做的^_^.劝说无果/(ㄒoㄒ)/~~,只能通过 OCR 技术来 ...

  10. spring之pom.xml配置

    spring之pom.xml配置 <?xml version="1.0" encoding="UTF-8"?> <project xmlns= ...