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

查看:104
本文介绍了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.698 12790-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并添加为库.我不得不将罐子复制到android/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天全站免登陆