java.lang.UnsatifiedLinkError:无法';从加载程序findLibrary加载时返回null

java.lang.UnsatifiedLinkError:无法';从加载程序findLibrary加载时返回null,java,android,android-ndk,Java,Android,Android Ndk,我在eclipse中使用NDK 这是我的java NativeLib: public class NativeLib { public native String enCode(String src); static { System.loadLibrary("HelloWorld"); } public native String deCode(String src); } 这是C源代码: #include <string.h> #include <jni.h

我在eclipse中使用NDK

这是我的java NativeLib:

public class NativeLib {

public native String enCode(String src);

static {
    System.loadLibrary("HelloWorld");
}

public native String deCode(String src);
}
这是C源代码:

#include <string.h>
#include <jni.h>
#include <stdio.h>

jstring Java_com_example_helloworld_NativeLib_enCode(JNIEnv* env,
    jobject thiz, jstring src) {
...
return (*env)->NewStringUTF(env, result);
}

jstring Java_com_example_helloworld_NativeLib_deCode(JNIEnv* env, jobject thiz,
    jstring src) {
...
return (*env)->NewStringUTF(env, result);
}
#包括
#包括
#包括
jstring Java_com_示例_helloworld_NativeLib_enCode(JNIEnv,
jobject thiz,jstring src){
...
return(*env)->NewStringUTF(env,result);
}
jstring Java_com_示例_helloworld_NativeLib_deCode(JNIEnv*env,jobject thiz,
jstring(src){
...
return(*env)->NewStringUTF(env,result);
}
我的项目在安卓4.2中正常运行,但在安卓4.3(平板电脑ASUS K012)中,它会出现如下错误

java.lang.UnsatifiedLinkError:无法从加载程序dalvik.system.PathClassLoader[DexPathList[[zip文件”/data/app/com.example.HelloWorld-2.apk“],NativelLibraryDirectory=[/data/app-lib/com.example.HelloWorld-2,/vendor/lib,/system/lib,/system/lib,/system/lib/arm]]:findLibrary返回null


有人能帮我吗?

可能是因为您没有为所有平台编译本机代码。华硕K012正在运行英特尔处理器,这可能就是原因。在JNI文件夹中添加一个名为application.mk的文件,并添加以下参数 APP_ABI:=全部


这将编译所有平台的本机部分

这个平板电脑里有什么处理器?您是否为该处理器提供了本机库?@Selvin我不明白。我忘了我和vitamio一起使用我的图书馆。如果我不使用vitamio,它运行正常。你是如何解决这个问题的?