Skip to content Skip to sidebar Skip to footer

Android Ndk App Failed To Load Library

My native library code: #include #include jstring Java_com_mindtherobot_samples_ndkfoo_NdkFooActivity_invokeNativeFunction(JNIEnv* env, jobject java

Solution 1:

Your classname is visibly not NdkFooActivity. Also make sure that your java package is com.mindtherobot.samples.ndkfoo. The name of native function and the Java context from which are you calling it must be in sync. Normally you would produce the native header with javah -jni which works on the already compiled class, not the java sources.

Solution 2:

The library name you pass to System.loadLibrary() should simply be pacman, not libpacman.

Solution 3:

According to my experiences in NDK,the path of your class in Android App must be the same as

Java_com_mindtherobot_samples_ndkfoo_NdkFooActivity_invokeNativeFunction



Java_com_mindtherobot_samples_ndkfoo [package name]
NdkFooActivity [activity or class name]
invokeNativeFunction [function name]

Post a Comment for "Android Ndk App Failed To Load Library"