您好我一直在尝试在我的三星Galaxy S6上测试我的代码,但由于不满意的链接器错误,它一直在崩溃。以下是错误消息:
AndroiddRuntime: FATAL EXCEPTION: main
Process: com.example.ericagredo.marvinproject, PID: 14982
java.lang.UnsatisfiedLinkError: Native library (com/sun/jna/android-aarch64/libjnidispatch.so) not found in resource path (.)
at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:866)
at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:826)
at com.sun.jna.Native.<clinit>(Native.java:140)
at com.sun.jna.Native.loadLibrary(Native.java:481)
at com.emotiv.iedk.Edk.<clinit>(Edk.java:15)
at com.example.ericagredo.marvinproject.MainActivity.onCreate(MainActivity.java:52)
at android.app.Activity.performCreate(Activity.java:6374)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2767)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2879)
at android.app.ActivityThread.access$900(ActivityThread.java:182)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1475)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6141)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
我使用jna.jar作为库,我相信问题源于此。当我进入文件夹时,没有名为android-aarch64的文件夹,我不知道如何获取它。
以下是jna.jar中的文件夹: Screenshot
答案 0 :(得分:0)
它主要发生在您使用本机库时,并且Android Gradle中还没有支持本机代码 本地图书馆试试这个
将您的库放入这些文件夹并重建您的项目
希望这会有所帮助
答案 1 :(得分:0)