我正在将 prolog 中开发的游戏链接到 android studio whith jpl ( http://jpl7.org/740/doc/index.html ) 中的 android 应用程序,当我使用库 jpl7 的功能时发生错误。
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.android.sevens, PID: 25397
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.android.sevens-1/base.apk", zip file "/data/app/com.example.android.sevens-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.android.sevens-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.android.sevens-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.android.sevens-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.android.sevens-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.android.sevens-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.android.sevens-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.android.sevens-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.android.sevens-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.example.android.sevens-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.example.android.sevens-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.example.android.sevens-1/lib/arm64, /data/app/com.example.android.sevens-1/base.apk!/lib/arm64-v8a, /data/app/com.example.android.sevens-1/split_lib_dependencies_apk.apk!/lib/arm64-v8a, /data/app/com.example.android.sevens-1/split_lib_slice_0_apk.apk!/lib/arm64-v8a, /data/app/com.example.android.sevens-1/split_lib_slice_1_apk.apk!/lib/arm64-v8a, /data/app/com.example.android.sevens-1/split_lib_slice_2_apk.apk!/lib/arm64-v8a, /data/app/com.example.android.sevens-1/split_lib_slice_3_apk.apk!/lib/arm64-v8a, /data/app/com.example.android.sevens-1/split_lib_slice_4_apk.apk!/lib/arm64-v8a, /data/app/com.example.android.sevens-1/split_lib_slice_5_apk.apk!/lib/arm64-v8a, /data/app/com.example.android.sevens-1/split_lib_slice_6_apk.apk!/lib/arm64-v8a, /data/app/com.example.android.sevens-1/split_lib_slice_7_apk.apk!/lib/arm64-v8a, /data/app/com.example.android.sevens-1/split_lib_slice_8_apk.apk!/lib/arm64-v8a, /data/app/com.example.android.sevens-1/split_lib_slice_9_apk.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]] couldn't find "libjpl.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:972)
at java.lang.System.loadLibrary(System.java:1530)
at org.jpl7.JPL.loadNativeLibrary(JPL.java:112)
at org.jpl7.fli.Prolog.<clinit>(Prolog.java:70)
at org.jpl7.fli.Prolog.thread_self(Native Method)
at org.jpl7.Query.open(Query.java:300)
at org.jpl7.Util.textToTerm(Util.java:127)
at org.jpl7.Query.<init>(Query.java:185)
at com.example.android.sevens.Main2Activity.play(Main2Activity.java:29)
at com.example.android.sevens.Main2Activity.onCreate(Main2Activity.java:23)
at android.app.Activity.performCreate(Activity.java:6847)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2649)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2757)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1504)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:163)
at android.app.ActivityThread.main(ActivityThread.java:6237)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:877)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
编码:
1.package com.example.android.sevens;
2.
3.import android.net.Uri;
4.import android.os.Bundle;
5.import android.support.v7.app.AppCompatActivity;
6.import android.support.v7.widget.Toolbar;
7.import android.widget.TextView;
8.
9.import org.jpl7.Query;
10.import org.jpl7.Term;
11.
12.import java.util.Map;
13.
14.public class Main2Activity extends AppCompatActivity {
15.
16. @Override
17. protected void onCreate(Bundle savedInstanceState) {
18. super.onCreate(savedInstanceState);
19. setContentView(R.layout.activity_main2);
20. Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
21. setSupportActionBar(toolbar);
22.
23. play();
24. }
25.
26. public void play(){
27. Map<String, Term> solution;
28.
29. Query q = new Query("member(2,[1,2,3])");
30. q.hasSolution();
(...)
先感谢您。