如何让我的应用程序与 AndEngine Phyiscs Box2D 扩展一起使用?
我从 AndEngine 应用程序开始,我想使用Physics Box2D 扩展。我已将 andenginephysicalsbox2dextension.jar
放入 /lib
中,并将其添加到 Eclipse 中的构建路径中。我还将 andenginephysicalsbox2dextension.so
放入 /libs/armeabi
中。 (我还没有对它做任何事情,它是否还需要添加到项目的某个地方?)。当我尝试编译我的应用程序时,我得到一个带有以下堆栈跟踪的 FC:
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(BaseGameActivity.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)
我做错了什么?
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(BaseGameActivity.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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不知道问题是什么,但重新下载所有内容,并添加
libxmp.so
解决了问题。I don't know what the problem was, but re-downloading everything, and also adding
libxmp.so
fixed the problem.该文件在 AndEngine 示例项目中称为
libandenginephysicalsbox2dextension.so
。尝试重命名它。
That file is called
libandenginephysicsbox2dextension.so
in the AndEngine examples project.Try renaming it.