Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

libgdx liquidfun integration runtime error

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: 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)

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]]

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.

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");
    }
like image 619
Apetroaei Andrei Avatar asked Dec 05 '25 03:12

Apetroaei Andrei


1 Answers

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

like image 121
Apetroaei Andrei Avatar answered Dec 08 '25 16:12

Apetroaei Andrei



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!