Title: No Implementation found for native in ndk
Tags: java;android;android-ndk;java-native-interface
Question: I am struck with an error, using the jni ... I have a simple native method in android activity class and created header for that and implemented the c file for that...unable to find the mistake pls help
Here are the files that I have
Activity
static{
System.loadLibrary("fluidsynth");
private  native String textOverjni();
Header file
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h&gt;
/* Header for class com_example_fluidsynthtest_MyFluidSynthO */
#ifndef _Included_com_example_fluidsynthtest_MyFluidSynthO
#define _Included_com_example_fluidsynthtest_MyFluidSynthO
#ifdef __cplusplus
extern "C" {
#endif
#undef com_example_fluidsynthtest_MyFluidSynthO_MODE_PRIVATE
#define com_example_fluidsynthtest_MyFluidSynthO_MODE_PRIVATE 0L
#undef com_example_fluidsynthtest_MyFluidSynthO_MODE_WORLD_READABLE
#define com_example_fluidsynthtest_MyFluidSynthO_MODE_WORLD_READABLE 1L
#undef com_example_fluidsynthtest_MyFluidSynthO_MODE_WORLD_WRITEABLE
#define com_example_fluidsynthtest_MyFluidSynthO_MODE_WORLD_WRITEABLE 2L
#undef com_example_fluidsynthtest_MyFluidSynthO_MODE_APPEND
#define com_example_fluidsynthtest_MyFluidSynthO_MODE_APPEND 32768L
#undef com_example_fluidsynthtest_MyFluidSynthO_BIND_AUTO_CREATE
#define com_example_fluidsynthtest_MyFluidSynthO_BIND_AUTO_CREATE 1L
#undef com_example_fluidsynthtest_MyFluidSynthO_BIND_DEBUG_UNBIND
#define com_example_fluidsynthtest_MyFluidSynthO_BIND_DEBUG_UNBIND 2L
#undef com_example_fluidsynthtest_MyFluidSynthO_BIND_NOT_FOREGROUND
#define com_example_fluidsynthtest_MyFluidSynthO_BIND_NOT_FOREGROUND 4L
#undef com_example_fluidsynthtest_MyFluidSynthO_CONTEXT_INCLUDE_CODE
#define com_example_fluidsynthtest_MyFluidSynthO_CONTEXT_INCLUDE_CODE 1L
#undef com_example_fluidsynthtest_MyFluidSynthO_CONTEXT_IGNORE_SECURITY
#define com_example_fluidsynthtest_MyFluidSynthO_CONTEXT_IGNORE_SECURITY 2L
#undef com_example_fluidsynthtest_MyFluidSynthO_CONTEXT_RESTRICTED
#define com_example_fluidsynthtest_MyFluidSynthO_CONTEXT_RESTRICTED 4L
#undef com_example_fluidsynthtest_MyFluidSynthO_RESULT_CANCELED
#define com_example_fluidsynthtest_MyFluidSynthO_RESULT_CANCELED 0L
#undef com_example_fluidsynthtest_MyFluidSynthO_RESULT_OK
#define com_example_fluidsynthtest_MyFluidSynthO_RESULT_OK -1L
#undef com_example_fluidsynthtest_MyFluidSynthO_RESULT_FIRST_USER
#define com_example_fluidsynthtest_MyFluidSynthO_RESULT_FIRST_USER 1L
#undef com_example_fluidsynthtest_MyFluidSynthO_DEFAULT_KEYS_DISABLE
#define com_example_fluidsynthtest_MyFluidSynthO_DEFAULT_KEYS_DISABLE 0L
#undef com_example_fluidsynthtest_MyFluidSynthO_DEFAULT_KEYS_DIALER
#define com_example_fluidsynthtest_MyFluidSynthO_DEFAULT_KEYS_DIALER 1L
#undef com_example_fluidsynthtest_MyFluidSynthO_DEFAULT_KEYS_SHORTCUT
#define com_example_fluidsynthtest_MyFluidSynthO_DEFAULT_KEYS_SHORTCUT 2L
#undef com_example_fluidsynthtest_MyFluidSynthO_DEFAULT_KEYS_SEARCH_LOCAL
#define com_example_fluidsynthtest_MyFluidSynthO_DEFAULT_KEYS_SEARCH_LOCAL 3L
#undef com_example_fluidsynthtest_MyFluidSynthO_DEFAULT_KEYS_SEARCH_GLOBAL
#define com_example_fluidsynthtest_MyFluidSynthO_DEFAULT_KEYS_SEARCH_GLOBAL 4L
* Class:     com_example_fluidsynthtest_MyFluidSynthO
* Method:    textOverjni
* Signature: ()Ljava/lang/String;
JNIEXPORT jstring JNICALL Java_com_example_fluidsynthtest_MyFluidSynthO_textOverjni
(JNIEnv *, jobject);
#ifdef __cplusplus
#endif
#endif
C file
#include <jni.h&gt;
#include <string.h&gt;
#include <MyFluidSynthO.h&gt;
JNIEXPORT jstring  Java_com_example_fluidsynthtest_MyFluidSynthO_textOverjni
(JNIEnv* env, jobject obj){
return (*env)-&gt;NewStringUTF(env, "Hello Worlddd from MyFluidSynth1 !");
Android.mk
LOCAL_PATH := $(call my-dir)
include  $(CLEAR_VARS)
LOCAL_MODULE   := fluidsynth
#LOCAL_C_INCLUDES +:= $(LOCAL_PATH)/include\
$(LOCAL_PATH)/include/fluidsynth
LOCAL_SRC_FILES +:= \
MyFluidSynthO.c
#LOCAL_LDLIBS := -llog
include  $(BUILD_SHARED_LIBRARY)
#include $(CLEAR_VARS)
#include $(BUILD_SHARED_LIBRARY)
Comment: Can you include the error message you see in logcat?


Here is another answer: build the .so file once again by ndk_build

Here is another answer: For "No implementation found" issues while building Android NDK, you can look into following links which explain the reasons and solutions for these problems.
Android NDK C++ JNI (no implementation found for native...)
android ndk jni No implementation found error
&quot;No implementation found for native&quot; error when calling C function - Android NDK - Eclipse

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 1, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2013:00:03/13/13', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<java><android><android-ndk><java-native-interface>', 'Title': 'No Implementation found for native in ndk', 'ViewCount': 23389, 'id': 15386204, 'user_AboutMe': '', 'user_AccountId': 375953.0, 'user_DisplayName': 'amj', 'user_Reputation': 357.0, 'user_Views': 127.0, 'user_id': 727091.0}}