Crash when running the totorials

  ... in the unlikely case you discovered a bug, post it here.

Crash when running the totorials

Postby kitramos » Mon Aug 22, 2011 1:05 am

Hello, I do got some experience with making android apps I have managed to publish a few. and i did mange to install mercury and download the andengine and all the plugin library's mentioned in the properties of the example project (using the default branch on all of them)

I got it to compile and I got some of the items working but when I try to go into the physics examples or bring up any of the games it crashes. saying library not found, but I have downloaded that via mercury, and does show that library is linked in the project properties. also I'm a bit confused on the tutorial it's asking me to do something with a jar file but it doesn't mention where to get or how to make it. can someone help me please?

" 08-21 22:29:47.563: ERROR/AndroidRuntime(344): Caused by: java.lang.UnsatisfiedLinkError: Library andenginephysicsbox2dextension not found"

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. 08-21 22:29:47.533: ERROR/AndroidRuntime(344): Uncaught handler: thread main exiting due to uncaught exception
  2. 08-21 22:29:47.563: ERROR/AndroidRuntime(344): java.lang.ExceptionInInitializerError
  3. 08-21 22:29:47.563: ERROR/AndroidRuntime(344):     at org.anddev.andengine.examples.PhysicsExample.onLoadScene(
  4. 08-21 22:29:47.563: ERROR/AndroidRuntime(344):     at org.anddev.andengine.ui.activity.BaseGameActivity.doResume(
  5. 08-21 22:29:47.563: ERROR/AndroidRuntime(344):     at org.anddev.andengine.ui.activity.BaseGameActivity.onWindowFocusChanged(
  6. 08-21 22:29:47.563: ERROR/AndroidRuntime(344):     at$DecorView.onWindowFocusChanged(
  7. 08-21 22:29:47.563: ERROR/AndroidRuntime(344):     at android.view.View.dispatchWindowFocusChanged(
  8. 08-21 22:29:47.563: ERROR/AndroidRuntime(344):     at android.view.ViewGroup.dispatchWindowFocusChanged(
  9. 08-21 22:29:47.563: ERROR/AndroidRuntime(344):     at android.view.ViewRoot.handleMessage(
  10. 08-21 22:29:47.563: ERROR/AndroidRuntime(344):     at android.os.Handler.dispatchMessage(
  11. 08-21 22:29:47.563: ERROR/AndroidRuntime(344):     at android.os.Looper.loop(
  12. 08-21 22:29:47.563: ERROR/AndroidRuntime(344):     at
  13. 08-21 22:29:47.563: ERROR/AndroidRuntime(344):     at java.lang.reflect.Method.invokeNative(Native Method)
  14. 08-21 22:29:47.563: ERROR/AndroidRuntime(344):     at java.lang.reflect.Method.invoke(
  15. 08-21 22:29:47.563: ERROR/AndroidRuntime(344):     at$
  16. 08-21 22:29:47.563: ERROR/AndroidRuntime(344):     at
  17. 08-21 22:29:47.563: ERROR/AndroidRuntime(344):     at dalvik.system.NativeStart.main(Native Method)
  18. 08-21 22:29:47.563: ERROR/AndroidRuntime(344): Caused by: java.lang.UnsatisfiedLinkError: Library andenginephysicsbox2dextension not found
  19. 08-21 22:29:47.563: ERROR/AndroidRuntime(344):     at java.lang.Runtime.loadLibrary(
  20. 08-21 22:29:47.563: ERROR/AndroidRuntime(344):     at java.lang.System.loadLibrary(
  21. 08-21 22:29:47.563: ERROR/AndroidRuntime(344):     at org.anddev.andengine.extension.physics.box2d.PhysicsWorld.<clinit>(
  22. 08-21 22:29:47.563: ERROR/AndroidRuntime(344):     ... 15 more
Parsed in 0.016 seconds, using GeSHi
Posts: 2
Joined: Mon Aug 22, 2011 12:36 am

Re: Crash when running the totorials

Postby recastrodiaz » Mon Aug 22, 2011 11:55 pm

I got the same error as yours a few days ago while trying the AndEngine examples from the mercurial repository. The error seems pretty obvious the lib andenginephysicsbox2dextension is not found because it's a native library and I suppose you haven't compiled it compiled yet. To successfully compile it, you'll have to download, install and test the NDK, and then build it with the cygwin console ( if you're in windows) :

cd to your andenginephysicsbox2dextension folder

I also had to modify the file : andenginephysicsbox2dextension\jni\ because the compiler gave me strange errors. This bug has already been fixed here and should appear in the next ndk release ( > r6 ). Anyway, I had to remove the x86 builds :

APP_ABI := armeabi armeabi-v7a

Finally, after I had compiled the physics wrappers, eclipse had trouble building my apk. There was some kind of error with the modplayer extension, I tried rebuilding the native code but got some weird errors too, so I temporarily disabled the mod extension example.

I'm wondering, do the Snake game work for you ?
Posts: 26
Joined: Mon Aug 22, 2011 11:32 pm
Location: Lyon, France

Re: Crash when running the totorials

Postby kitramos » Thu Aug 25, 2011 1:46 am

hello I got the cgwin installed and I got the ndk downloaded but it's giving me a command not found error when i try to do the build so I'm not sure what i'm doing wrong. the install doc that came with the ndk pretty much just said what I needed to have installed before I attempt to install it but no mention on how to actually install it.

if there's an easier way I can get hold of what I need to start working with this project i'd like to know what it is. this building from source seems to be a royal pain.

and to answer your question, none of he games work for me.
Posts: 2
Joined: Mon Aug 22, 2011 12:36 am

Re: Crash when running the totorials

Postby recastrodiaz » Thu Aug 25, 2011 9:45 am

Installing and usign the NDK is pretty forward once cygwin is correctly install. The only step you're missing is adding the ndk folder to the PATH. This should fix the command not found error.

Correct me if I'm wrong, but I think you may also download a jar file and forget about everything else. Though I'd prefer having the source code.

The last time I checked, there was an error in getFontManager() . To make the snake game work you should also add the following fix : bugs/wrong-getfontmanager-call-in-basegameactivity-t4606.html
Posts: 26
Joined: Mon Aug 22, 2011 11:32 pm
Location: Lyon, France

Re: Crash when running the totorials

Postby drjava72 » Mon Aug 29, 2011 11:14 am

There shouldn't be any need of compiling from NDK. previously getting andengne examples to work were pretty straight forward, we might be doing something wrong... Nicolas please help....

One can see all the references of those libraries but "libs" folder is missing...
Best Regards,
Posts: 287
Joined: Fri Apr 29, 2011 8:03 am

Re: Crash when running the totorials

Postby RealMayo » Sat Sep 03, 2011 9:44 pm

Hello, I just thought I'd share that after countless hours I finally got the PHYSICS (Box2D examples) working in the AVD emulator via Eclipse. For example I can successfully run the AndEngine Example called Using Physics (which runs However I still cannot run any of the game samples in the Emulator.

Here's the solution for getting the to work:
I did not use the NDK. I did not use Cygwin. The key solution was to do the following...
1) In Eclipse, in the AndEngineExamples project, create a folder called libs (Note: that is libs with an S at the end!)
2) In your new libs folder create a subfolder called armeabi
3) Go to the following URL...
4) At that URL right-click the View Raw File link and then Save Target to your computer
5) Paste that file (which is called into your armeabi folder in Eclipse. That's it!

You do not need to use (nor create) andenginephysicsbox2dextension.jar
Instead of using that JAR file, you should import the Box2D extension as a Mercurial Clone into Eclipse. Then tie that extension to your AndEngineExamples project. For more information on this part go here...

I hope that helps!
User avatar
Posts: 1694
Joined: Sat Sep 03, 2011 9:25 pm
Location: Chicago, IL

Re: Crash when running the totorials

Postby kpraveen72 » Mon Oct 17, 2011 9:12 am

RealMayo - it works for me. Its awesome ... thanks a lot

But can someone explain me why the hell "" is required? that too in "libs/armebi" folder..?

can someone explain this.. :(
Posts: 1
Joined: Sun Oct 16, 2011 6:21 pm

Return to Bugs

Who is online

Users browsing this forum: No registered users and 2 guests