Android SDK应用无法加载库

Heyho.我有与此人相同的错误消息:
Android NDK app failed to load library
而我现在试图将这些答案转移到我的情况上几个小时,但它不起作用.
有人能帮我吗?
这是这个开源项目,我想尝试让它在我的模拟器上运行.
https://github.com/itskewpie/FreeRDP-android

FreeRDPActivity.java

package net.itskewpie.freerdp;

import android.app.Activity;
import android.os.Bundle;

public class FreeRDPActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    } 
    static {       
        System.loadLibrary("freerdp");
    }  
}

freerdp.c

#include <jni.h>
#include <stdio.h>
#include <freerdp/freerdp.h>

jstring Java_net_itskewpie_freerdp_FreeRDPActivity_test(JNIEnv* env, jobject thiz )
{
    android_main();      
    return (*env)->NewStringUTF(env, "HELLO");
}

Android.mk

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

MY_LIBS_PATH=freerdp-1.0-nevo/libs/armeabi-v7a
LOCAL_MODULE    := freerdp-utils
LOCAL_SRC_FILES := $(MY_LIBS_PATH)/libfreerdp-utils.a
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/freerdp-1.0-nevo/include
include $(PREBUILT_STATIC_LIBRARY)
...

错误信息:

FATAL EXCEPTION: main
java.lang.ExceptionInInitializerError
java.lang.Class.newInstanceImpl(Native Method)
java.lang.Class.newInstance(Class.java:1319)
android.app.Instrumentation.newActivity(Instrumentation.java:1054)
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
android.app.ActivityThread.access$600(ActivityThread.java:141)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
android.os.Handler.dispatchMessage(Handler.java:99)
android.os.Looper.loop(Looper.java:137)
android.app.ActivityThread.main(ActivityThread.java:5041)
java.lang.reflect.Method.invokeNative(Native Method)
java.lang.reflect.Method.invoke(Method.java:511)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
dalvik.system.NativeStart.main(Native Method)
java.lang.UnsatisfiedLinkError: Couldn't load freerdp from loader dalvik.system.PathClassLoader[dexPath=/data/app/net.itskewpie.freerdp-2.apk,libraryPath=/data/app-lib/net.itskewpie.freerdp-2]: findLibrary returned null
java.lang.Runtime.loadLibrary(Runtime.java:365)
java.lang.System.loadLibrary(System.java:535)
net.itskewpie.freerdp.FreeRDPActivity.<clinit>(FreeRDPActivity.java:16)
... 15 more

解决方法:

试试这个开源项目:

www.freerdp.com

上一篇:java实现远程登录RDP


下一篇:C#检查RDP用户登录