问题描述
我是新来的.我使用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.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.
注意:我也尝试加载本机库,并且它们不会引发任何错误.
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集成运行时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!