0
votes

I am trying to use the libGDX box2d wrapper, but I do not want to use the the full libGDX game engine, because I already have my game implemented and now I want to add some physics.

So, I downloaded the libGDX libraries and put them in build path.

I see the following error:

UnsatisfiedLinkError at com.badlogic.gdx.physics.box2d.World.newWorld(Native Method)
at com.badlogic.gdx.physics.box2d.World.<init>(World.java:101)
at org.anddev.andengine.extension.physics.box2d.PhysicsWorld.<init>(PhysicsWorld.java:61)
at org.anddev.andengine.extension.physics.box2d.PhysicsWorld.<init>(PhysicsWorld.java:57)

What can I do?

2
there is an UnsatisfiedLinkError and at com.badlogic.gdx.physics.box2d.World.newWorld(Native Method) at com.badlogic.gdx.physics.box2d.World.(World.java:101) at org.anddev.andengine.extension.physics.box2d.PhysicsWorld.(PhysicsWorld.java:61) at org.anddev.andengine.extension.physics.box2d.PhysicsWorld.(PhysicsWorld.java:57) - seipey
if anybody has this problem, i have solverd it: with this post found in another forum: import com.badlogic.gdx.utils.GdxNativesLoader; GdxNativesLoader.load(); Use this before you do anything. make sure you have gdx.jar and gdx-natives.jar in your project. Useful if you just want to use the physics library without anything else from libgdx. I use it on the server side. - seipey
@seipey, could you add your solution as a real 'answer' on this question? Thanks. - P.T.

2 Answers

2
votes

I use this code from google discussion and it's working fine at my side.

import com.badlogic.gdx.utils.GdxNativesLoader;
GdxNativesLoader.load(); 

Use this before you do anything. make sure you have gdx.jar and gdx-natives.jar in your project.

0
votes

This error will happen if you assign an instance during a World property declaration, keeping an empty declaration and assigning the new instance on the App create() method should fix it.