1

我试图将liquidfun 添加到我的android studio 项目中。除了第 3 步的最后一部分之外,我已经完成了本教程中的所有内容(因为我在 android studio 工作,所以我已经完成了:

file > project structure > green plus > import jar/aar package > file name: 
core\libs\gdx-liquidfun.jar Subproject name: gdx-liquidfun > finish > ok)

在桌面上一切正常,但在 android 上我收到此错误

E/AndroidRuntime: FATAL EXCEPTION: GLThread 6081
          Process: clepsydra.app, PID: 18425
          java.lang.ExceptionInInitializerError
              at clepsydra.app.AppClass.create(AppClass.java:65)
              at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:311)
              at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1555)
              at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1270)
           Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load shared library 'gdx-liquidfun' for target: Linux, 32-bit
              at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:125)
              at com.badlogic.gdx.physics.box2d.World.<clinit>(World.java:272)
              at clepsydra.app.AppClass.create(AppClass.java:65) 
              at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:311) 
              at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1555) 
              at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1270) 
           Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/base.apk", zip file "/data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/split_lib_dependencies_apk.apk", zip file "/data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/split_lib_slice_0_apk.apk", zip file "/data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/split_lib_slice_1_apk.apk", zip file "/data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/split_lib_slice_2_apk.apk", zip file "/data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/split_lib_slice_3_apk.apk", zip file "/data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/split_lib_slice_4_apk.apk", zip file "/data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/split_lib_slice_5_apk.apk", zip file "/data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/split_lib_slice_6_apk.apk", zip file "/data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/split_lib_slice_7_apk.apk", zip file "/data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/split_lib_slice_8_apk.apk", zip file "/data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/lib/arm64, /data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/base.apk!/lib/arm64-v8a, /data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/split_lib_dependencies_apk.apk!/lib/arm64-v8a, /data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/split_lib_slice_0_apk.apk!/lib/arm64-v8a, /data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/split_lib_slice_1_apk.apk!/lib/arm64-v8a, /data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/split_lib_slice_2_apk.apk!/lib/arm64-v8a, /data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/split_lib_slice_3_apk.apk!/lib/arm64-v8a, /data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/split_lib_slice_4_apk.apk!/lib/arm64-v8a, /data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/split_lib_slice_5_apk.apk!/lib/arm64-v8a, /data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/split_lib_slice_6_apk.apk!/lib/arm64-v8a, /data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/split_lib_slice_7_apk.apk!/lib/arm64-v8a, /data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/split_lib_slice_8_apk.apk!/lib/arm64-v8a, /data/app/clepsydra.app-can97djwNZxAb-8dCNZjKQ==/split_lib_slice_9_apk.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]] couldn't find "libgdx-liquidfun.so"
              at java.lang.Runtime.loadLibrary0(Runtime.java:1011)
              at java.lang.System.loadLibrary(System.java:1657)
              at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:119)
              at com.badlogic.gdx.physics.box2d.World.<clinit>(World.java:272) 
              at clepsydra.app.AppClass.create(AppClass.java:65) 
              at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:311) 
              at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1555) 
              at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1270)

我在谷歌上寻找任何解决方案,但没有找到任何解决问题的方法。

4

1 回答 1

1

更新了教程,但缺少桌面依赖性 compile fileTree(dir: 'libs', include: '*.jar') 有了这个一切都很好。

如果有人需要,我的依赖项

project(":desktop") {
apply plugin: "java"


dependencies {
    compile project(":core")
    compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
    compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
    compile fileTree(dir: '../core/libs', include: '*.jar')
    compile fileTree(dir: 'libs', include: '*.so')
    compile fileTree(dir: 'libs', include: '*.jar')
}
}

project(":android") {
apply plugin: "android"

configurations { natives }

dependencies {
    compile project(":core")
    compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a"
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
    compile fileTree(dir: '../core/libs', include: '*.jar')
    compile fileTree(dir: 'libs', include: '*.so')
}
}

project(":core") {
apply plugin: "java"


dependencies {
    compile "com.badlogicgames.gdx:gdx:$gdxVersion"
    compile fileTree(dir: 'libs', include: '*.jar')
}
}
于 2018-05-14T17:59:28.027 回答