开发者

How do I get my app to work with AndEngine Phyiscs Box2D Extension?

开发者 https://www.devze.com 2023-03-29 10:46 出处:网络
I\'m starting out with an AndEngine app, and I want to use the Physics Box2D extension. I\'ve put andenginephysicsbox2dextension.jar in /lib and added it to the Build Path in Eclipse. I\'ve also put a

I'm starting out with an AndEngine app, and I want to use the Physics Box2D extension. I've put andenginephysicsbox2dextension.jar in /lib and added it to the Build Path in Eclipse. I've also put andenginephysicsbox2dextension.so in /libs/armeabi. (I haven't done anything with it, does it also need to be added to the project somewhere?). When I try and compile my app, I get a FC with the following stack trace:

FATAL EXCEPTION: main
java.lang.UnsatisfiedLinkError: newWorld
    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)
    at com.tommedley.helloandengine.HelloAndEngine.onLoadScene(HelloAndEngine.java:96)
    at org.anddev.andengine.ui.activity.BaseGameActivity.doResume(BaseGameActiv开发者_运维技巧ity.java:169)
    at org.anddev.andengine.ui.activity.BaseGameActivity.onWindowFocusChanged(BaseGameActivity.java:85)
    at com.android.internal.policy.impl.PhoneWindow$DecorView.onWindowFocusChanged(PhoneWindow.java:2047)
    at android.view.View.dispatchWindowFocusChanged(View.java:3940)
    at android.view.ViewGroup.dispatchWindowFocusChanged(ViewGroup.java:659)
    at android.view.ViewRoot.handleMessage(ViewRoot.java:1974)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:130)
    at android.app.ActivityThread.main(ActivityThread.java:3835)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
    at dalvik.system.NativeStart.main(Native Method)

What am I doing wrong?


I don't know what the problem was, but re-downloading everything, and also adding libxmp.so fixed the problem.


andenginephysicsbox2dextension.so

That file is called libandenginephysicsbox2dextension.so in the AndEngine examples project. Try renaming it.

0

精彩评论

暂无评论...
验证码 换一张
取 消