Wednesday, January 2, 2013

AndEngine and "Conversion to Dalvik format failed with error 1"

I am developing a word puzzle game called Word Drift using AndEngine.  While everything went well, I found that when I tried to sign the game (so that I can upload it to Google Play), I got the error "Conversion to Dalvik format failed with error 1"

Google around shown that it is common problem.  Many people solved it simply by clear the project and rebuild it.  Unfortunately all the solutions I found from searching did not solve the problem I had.

What made it very confusing is that when I remove some features off the game (thus reduce the number of lines in the code), I could sign the game without any problem.  Is my game too big?  It can't be. It's only a bit more than 10 thousand lines.

So I tried different settings and finally the problem went away. I don't really understand it but I'm posting what I did here hopefully it is helpful to some of you.

Basically, when I first started playing with AndEngine, I follow the excellent tutorial at by Ali Hafizji.  That tutorial asks you to add AndEngine library to your project using the Android-specific configuration dialog box (see picture below, in the Library box).

This is the configuration that worked when my game had fewer lines of code.  It failed to sign with my full game.  What I did to solve it is to remove the reference to AndEngine from my game from this dialog box, and add AndEngine library directly to the 'libs' directory in my game.

After rebuild the code, it signed properly.  I don't really know why it worked though.

By the way, if you are curious what my AndEngine game looks like, it is called Word Drift, a free, fast-pace word puzzle game and you can get it on Google Play (yes, those are bombs.  The only word puzzle game with bombs :)


  1. You saved my life! I was fighting with that sh*t too much time. Thank you:)

  2. Thanks man. Very clear post, worked perfectly for me.