I want to create a simple android project using native libs,
I copied existing native library from another Android project into my android project under jniLibs folder.
I am new in this, i will appreciate any help,
In my java code I load the library by:
public native String helloWorld();
static{
System.loadLibrary("ndktest");
}
When I run my new android project, I got an error:
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.benzy.finalimage-2/base.apk"],nativeLibraryDirectories=[/data/app/com.example.benzy.finalimage-2/lib/x86, /vendor/lib, /system/lib]]] couldn't find "libndktest.so"
And i don't have that file nowhere in my project.
The content of Android.mk is:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := ndktest
LOCAL_SRC_FILES := ndktest.c
include $(BUILD_SHARED_LIBRARY)
The content of Application.mk is:
APP_ABI := all
And my ndktest.c file is:
#include
#include
jstring java_com_example_benzy_finalimage_MainActivity_helloWorld(JNIEnv* env,jobject obj){
return (*env)->NewStringUTF(env,"hello world jni");
}
Thank you all.
↧