libgdx liquidfun 集成运行时错误 [英] libgdx liquidfun integration runtime error

查看:33
本文介绍了libgdx liquidfun 集成运行时错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新手.我使用 libgdx 项目生成器生成了一个新项目,一切正常.然后我尝试使用以下教程将liquidfun扩展添加到库中:https://github.com/finnstr/gdx-liquidfun-extension/wiki/Setup.它编译了在编辑器中看到的所有依赖项,但在运行时我收到此错误.

I'm new to this. I generated a new project using libgdx project generator, all worked fine. Then I tried to add liquidfun extension to the library using the following tutorial: https://github.com/finnstr/gdx-liquidfun-extension/wiki/Setup. It compiles all the dependencies are seen in the editor but at runtime I get this error.

java.lang.NoClassDefFoundError:解析失败:Lcom/badlogic/gdx/physics/box2d/World;10-09 10:29:50.69812790-12895/com.mygdx.game.android E/AndroidRuntime:在com.mygdx.game.MyGdxGame.createBox2DWorld(MyGdxGame.java:87)

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/badlogic/gdx/physics/box2d/World; 10-09 10:29:50.698 12790-12895/com.mygdx.game.android E/AndroidRuntime: at com.mygdx.game.MyGdxGame.createBox2DWorld(MyGdxGame.java:87)

导致作者:java.lang.ClassNotFoundException:找不到类路径上的com.badlogic.gdx.physics.box2d.World":DexPathList [[zip 文件"/data/app/com.mygdx.game.android-1/base.apk"],nativeLibraryDirectories=[/data/app/com.mygdx.game.android-1/lib/arm,/vendor/lib,/system/lib]]

Caused by: java.lang.ClassNotFoundException: Didn't find class "com.badlogic.gdx.physics.box2d.World" on path: DexPathList[[zip file "/data/app/com.mygdx.game.android-1/base.apk"],nativeLibraryDirectories=[/data/app/com.mygdx.game.android-1/lib/arm, /vendor/lib, /system/lib]]

我很关心这部分教程是为 Eclipse 制作的.我不知道如何在 Android Studio 中进行配置.

I am concered of this part of the tutorial which is made for eclipse. I don't know how to configure this in Android Studio.

为此,您应该右键单击 android 项目并选择属性 -> Java 构建路径 -> 添加外部 Jar 并选择核心/库/gdx-liquidfun.jar.最后一步是检查这个库订购和出口.

To do so you should right click on android project and select Properties -> Java Build Path -> Add external Jar and pick core/libs/gdx-liquidfun.jar. Last step is to check this library in Order and export.

注意:我也尝试加载本机库,它们没有抛出任何错误.

Note: I also tried to load the native libraries and they throw no error.

 static {
        System.loadLibrary("gdx-liquidfun");
        System.loadLibrary("gdx-box2d");
    }

推荐答案

我想通了.我必须右键单击 jar 并添加为库.我不得不将 jar 复制到 android/libs.来自 core/libs 的那个没有添加为库的选项

I figured it out. I had to right click the jar and Add As Library. I had to copy the jar to android/libs. The one from core/libs didn't have the option to Add as Library

这篇关于libgdx liquidfun 集成运行时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆