Sunday, July 10, 2011

Error conversion to Dalvik format failed with error 1


UPDATE: This issue was fixed in SDK Tools 17. If you have SDK Tools 17+ the solution here will not help you.

There is a bug in the latest Android SDK Tools (revisions 12, 13, 14, 15 & 16) which cause the following error:
Error conversion to Dalvik format failed with error 1
when you try to export your Android application & got Proguard enabled.

Google will probably fix it within few days, until then DO NOT UPDATE to Android SDK Tools revision 12. Someone already opened a bug on this issue.

Solution 1 - Restore SDK Tools v11 (ugly but it works):
If you did upgrade, the instructions how to install Android SDK Tools v11 on top can be found here. I did something similar which I think is safer & easy to undo:
1. Download Android SDK Tools v11 installer from here: http://dl.google.com/android/installer_r11-windows.exe
2. Rename the existing Android SDK\Tools folder to Tools-v12
3. Open the installer using 7zip, go to folder $_OUTDIR, and copy the folder 'Tools' the the position under Android SDK folder.

Solution 2 - Upgrade to Proguard 4.7 (needs to be reapplied after every SDK Tools upgrade):
Manually update Proguard to version 4.7. You'll have to do it again after each update of the SDK Tools.
1. Download Proguard 4.7 (zip): http://sourceforge.net/projects/proguard/files/proguard/4.7/
2. Extract the folders "bin" & "lib" from the zip on top the existing Proguard installation in the SDK Tools Proguard folders "bin" & "lib", should be around here (Win x64):
C:\Program Files (x86)\Google\Android SDK\tools\proguard

11 comments:

Chenio Software said...

Hey, thanks for this blog. I am glad that I found this right away after I started to have this issue :)

Girish said...

Thank you very much !

Gilberto Garcia said...

I spent three hours looking for this solution. Thank you!

Varun Rally said...
This comment has been removed by the author.
Vito Cassisi said...

Upgrading to ProGuard 4.6 worked for me.

Senthiil said...

Thanks for the post. Still i'm getting this issue. four months passed i don't know whether google fixed it or not.

Rus said...

Thanks man!! You are the best of the best. From Russia with love! =*

Tingting said...

Still get this error with latest SDK when exporting a Google API's project for 2.1. Works fine for 2.2 though...

Anonymous said...

Nice.. thank u sooo much.

132_MakeUp said...

Thank you very much, this worked very well.

132_MakeUp said...
This comment has been removed by the author.