My favorites | Sign in
Project Home Issues
New issue   Search
  Advanced search   Search tips   Subscriptions
Issue 18359: Android SDK tools revision 12 has problem with Proguard
53 people starred this issue and may be notified of changes. Back to list
Reported by, Jul 9, 2011
If you enable proguard.config in and try to export with sign key you will get "Error conversion to Dalvik format failed with error 1".
I hope someone can look into the issue.
Jul 11, 2011
Confirmed the problem is caused by ProGuard command line in R12 in the file [Android SDK Installation Directory]\tools\proguard\bin\proguard.bat (if you are using Windows). Simply edit the following line will solve the problem.

call %java_exe% -jar "%PROGUARD_HOME%"\lib\proguard.jar %*
call %java_exe% -jar "%PROGUARD_HOME%"\lib\proguard.jar %1 %2 %3 %4 %5 %6 %7 %8 %9

Jul 11, 2011
I can confirm that the work around works. Thanks!
Jul 13, 2011
I can't solve this problem by changing proguard.bat.
proguard.bat itself seems to work correctly (I ran proguard.bat by hand on command prompt).
In my temp directory, android_nnnnn.jar (= proguard's output jar) file is present, and size is not zero. Also android_nnnnn.dex file is present, but zero bytes.

Changing "%*" to "%1 %2 ..." removes -printseeds,  -printusage,  -printmapping parameters because these parameter offsets are greater than "%9".
I think this change may makes more difficult searching cause of problems when anything go wrong arround proguard.

Help me. I revert R12 to R11.
Jul 18, 2011
I tried to update proguard.jar of version from 4.4 to 4.6
it might be solved this issue.

your proguard.jar is here. [Android SDK Installation Directory]\tools\proguard\lib

please download latest proguard from the web.

Jul 19, 2011
comment 1 worked for me as well.
Jul 19, 2011
after updating my ADT to version 12 , am not able to Export signed apk with Progaurd enabled in Eclipse. 
Please help in solving this problem.

20.7 KB   View   Download
Jul 27, 2011
it's work!!!
When I was updated my proguard to v4.6 then try to export an APK file with a sample code "Hello xxx" and the error will not show up, thanks!
Jul 31, 2011
Proguard update to 4.6 (r12 comes with 4.4) solves the issue here too.
Jul 31, 2011
4.6 update works for me too.  So what's the deal here?  Why does ADT come with 4.4 when 4.6 has been out since February?  Simple packaging error or some other reason?
Jul 31, 2011
I found that Proguard (the one that is built-in to the SDK) is not cleaning up the temp files it creates and will attempt to use the old temp files to create the new APK. Once it does this, it fails with the error everyone has experienced.

I can reproduce this every time.

1. Clean temp directory reported by the console when building with verbose mode.
2. Export APK. Should work.
3. Change, rebuild and re-export. Should fail.
4. Clean temp.
5. Export again. Should work again.

To build with verbose in Eclipse: Window > Preferences > Android > Build > Build Output > Verbose

Then watch the Console view and you will see where it stops. A couple of lines up from the end you will see directories that are being used for the temp files.
Aug 2, 2011
Its happening to me too. The moment I upgraded to tools v12. I have to deploy a major update but I have no way to release it or downgrade to v11. Please fix this as soon as possible. Thanks.
Aug 3, 2011
Changed as described
call %java_exe% -jar "%PROGUARD_HOME%"\lib\proguard.jar %*
call %java_exe% -jar "%PROGUARD_HOME%"\lib\proguard.jar %1 %2 %3 %4 %5 %6 %7 %8 %9 

This solves the problem but we are pushing update in market, hopefully this will not cause any more problems. Any update on when fix is coming in for this problem.
Aug 13, 2011
Following the advice on comment #1 (editing the .bat file) worked for me.
Aug 15, 2011
only updating to proguare 4.6, worked for me
Aug 25, 2011
Updated to ProGuard 4.6 and the problem went away.
Aug 25, 2011
I also updated to ProGuard 4.6 per Comment 5 and this resolved the issue for
Sep 8, 2011
At first I got "Error conversion to Dalvik format failed with error 1".

I have then tried all of the suggestions above, updated to 4.6 and edited the proguard.bat. But now my export hangs on "Optimizing..." when I run in Verbose mode, using 4.6 without edited bat. The java.exe process eats all my memory and when I kills it, it returns with this message: "Proguard returned with error code 1. See console"

The strange thing is that it works on another app, but not on this particular one. The only difference in terms of extra jars is that the other app uses an external jar. The one not working only uses Vending Licence.

I'm completely stuck, any suggestions?
Sep 17, 2011
Comment #1 (proguard.bat parameters) and #5 (upgrading to proguard 4.6) doesn't help!

I tried to run from command line proguard with exact parameters as Eclipse runs, and this is the error:

"The output is up to date"

I have Win 7 64bit, Eclipse 3.7 and ADT r12.
Sep 22, 2011
Comment 5 fixed it for me, but I had to replace the contents of both folders: /lib and /bin.

I did not have to edit proguard.bat in my case.
Sep 29, 2011
Had same problem and solved it updating to ProGuard4.6.

At first, I modified the 
[Android SDK Installation Directory]\tools\proguard\bin\proguard.bat file, as suggested in #1, and didn't work.

After cleaning the project, deleting temp files, etc, only the upgrading option worked fine for me.

Oct 6, 2011
A summary of the issues I faced with Proguard and their solutions (considering SDK r12 on Windows):

First, if you have spaces in the path to your Eclipse workspace, you'll get errors of the form "proguard.ParseException: Unknown option". Remove the spaces... seems to be the only way around that. (This means creating a new workspace and migrating things into it.)

Second, for this "Error conversion to Dalvik format failed with error 1" thing, DON'T edit proguard.bat! That doesn't seem to help (or it only works for some configurations). Instead, just go to , get ProGuard 4.6 and extract everything in the proguard4.6 folder to your android-sdk-windows\tools\proguard folder.

Once I did these things I was able to do export builds with proguard enabled and stopped getting the various annoying errors.
Oct 20, 2011
This error maybe also indicate problems with your project. Here is what happened with my app:
I used a third party jar. Proguard failed to process this jar and the only error I got from Eclipse was the above mentioned "Error conversion to Dalvik format failed with error 1". Instead of using Eclipse, I switched to ant and I clearly saw what the problem was. After fixing it all went ok. I was able to compile from both ant and Eclipse.
Unfortunately Eclipse did not show anything more than the cryptic error we all complain about.
Since then I prefer ant for compilation. I am using Eclipse to edit the code only.
Oct 23, 2011
No spaces allowed for the path is very annoying - please fix this!
My Eclipse workspace doesn't contain spaces, but my project directories do. I don't want to change these.
Oct 30, 2011
I have recently upgraded to R15 (from R11) and the issue persist. I spent two days on trying different things, and have re-installed everything numerous times.

What did finally help is the upgrade of Proguard libs from v4.4 to v4.6.

I have tried to debug what is the cause of the issue, and I found that is related to using libraries (sub projects). In my case I have OpenFeint as a library/project which I use in main project. When signing the app, for some reason OpenFeint classes / library are not included while invoking Proguard, and Proguard is complaining that classes are missing.

Nov 2, 2011
This is still broken in ADT r14.

What's worse, Eclipse now ignores proguard.dir in - I previously made the error go away by having my own install of ProGuard 4.6, and pointing proguard.dir at that copy, with modified proguard.bat.

After updating to r14, the workaround stopped working, so I had to fix the batch file inside android-sdk\tools\proguard.

This first showed up in r11, I beleive, four releases back, maybe it's time to fix this issue?

Nov 6, 2011
(running r15 and proguard 4.4)
Found that exporting a release (signed or unsigned) only works one time, not a second time, even if nothing has changed meanwhile. So every time I want to export again (the same project or another one), I just exit/start Eclipse and it works (for me, so far..).
Nov 29, 2011
Project Member #32
(No comment was entered for this change.)
Status: Unassigned
Labels: Component-Tools
Nov 29, 2011
Project Member #33
Note that the .bat workaround to use %1..%9 is wrong since ADT calls proguard with way more than 10 parameters. That means some are just dropped and would explain some of the issues. Can someone reproduce this using one of the SDK samples? If so set ADT to build verbose mode and post here the proguard command line (please don't post the whole build output :-))
Dec 14, 2011
I can confirm that update proguard.jar from 4.4 to 4.6 fixed it for me, but I had to replace the contents of both folders: /lib and /bin.

I did not have to edit proguard.bat in my case.
Dec 27, 2011
I can confirm that upgrading to 4.6 by replacing contents of bin and lib fixed the issue for me.
Dec 29, 2011
upgrading to 4.6 fixed it for me, too. Thanks a lot.
Jan 12, 2012
Project Member #37
We're bundling ProGuard 4.7 with ADT 17, which should fix this issue.
Status: FutureRelease
Labels: Target-r17
Jan 17, 2012
WOOOOW worked for me too! from proguard 4.4 to 4.7
Jan 25, 2012
after an update of the ADT, the default location was changed from C:\Program Files\Android\android-sdks\tools\proguard\ to C:\Users\YourUser\android-sdks\tools\proguard\.

You should pay attention on where exactly is you android proguard installed.
Jan 28, 2012
Any of the above solutions didn't work for me, If someone has a better solution I would glad to look into it.
Jan 30, 2012
comment 41 did helped a lot! I was updating to 4.6 a different folder :)
Jan 31, 2012
None of these worked - Eclipse 3.7.1, WinXP
Upgraded from Proguard 4.4 to 4.7, even edited proguard.bat. Yet nothing works. Still get the error message "Conversion to Dalvik format failed with error 1"

This is so disappointing. How could an obvious bug like this make it into such a professional package for so long?
Android is a joke.
Feb 2, 2012
I've tried everything and nothing has worked. I have been struggling with this for two weeks now and have a build I need to release. This is BS
Feb 17, 2012
I've tried all suggestions and nothing has worked. My Proguard is 4.7, the project does not use any external jar. It just give me the cryptic message! I cant find any exception/error message in the console or anywhere! Frustrating that I cant find any clue of the problem! 

@Comment 25: Can you please explain how to use ant (on Win7).

Mar 23, 2012
Project Member #46
Fixed in ADT 17, now released.
Status: Released
Mar 24, 2012
I fixed this problem on ADT 12
Yesterday updated to ADT 17 - the error come back again! Unbelievable.... 
Mar 24, 2012
I've just updated to ADT 17... and i've again the problem...
Mar 24, 2012
Project Member #49
Can you guys give more information about what you're seeing with ADT 17? What is the *exact* error message?  Can you enable verbose build logging and attach the full information?

(Also -- Dalvik conversion can fail for other reasons than ProGuard, so I want to make sure you've seen this: )

Mar 24, 2012
none of my projects are getting compiled due to 3rd party jar and android libray projects and proguard. Can anybody let me knowhow to include 3rd part jar and andoid lib projects to other projects.
Mar 24, 2012
none of my projects are getting compiled due to 3rd party jar and android libray projects and proguard. Can anybody let me knowhow to include 3rd part jar and andoid lib projects to other projects.
Apr 3, 2012
Seems to be that it's complain that the jar class names have already been added to the project. As in they are already in the bin directory, which they would be.

I've tried moving the jar files out of the project completely, but now with the ADT 17 update it doesn't like the jar library files anywhere but in the libs directory. This used to work perfectly, now it's just a mess.
Apr 3, 2012
Fixed this by added by jar files to a different folder and then adding them to the build path. Making sure they are also exported as dependencies for the project. Not sure why they don't just work in the libs folder.
Apr 20, 2012
The problem is still happening on r18, and to make it worse, there are no discernible error messages in the logs. How do I figure out what the problem is and what "conversion to Dalvik format failed with error 1" even means?
Apr 20, 2012
I created an ant build, and I was able to see the error in the command line (why didn't the Sim Exception show in Eclipse?), and I was able to solve the problem by adding !code/allocation/variable to the -optimizations flag.
May 24, 2012
@comment 55
where did you added this !code/allocation/variable  line?
Jun 14, 2012
this is getting worst. Is there any solution?
Jul 20, 2012
Guys, I restarted windows and the issue was fixed.
Jul 20, 2012
Sorry, restarted and did a clean up. Is working fine right now.
Jul 24, 2012
Hi.... i run the android eclipse then i got a error message " PANIC: Missing arch-specific emulator program: C:\Users\lsn40\android-sdks\tools/emulator-arm.exe" i change the proguard file also but problem cannot resolved and i was able to solve the problem by change eclipse workspace also but no use.......

please help me
Apr 22, 2013
Updated proguard is the only solution ;)
Apr 24, 2013
Same error, same fix.  Updated to proguard 4.9.  Just download proguard and replace the directory in the SDK.
Aug 5, 2013
I had the same problem using proguard 4.7. Without optimisation it would create the package fine. But if optimisation was turned it would give this error. I was not using any extra libraries.  

I followed comment #56 and added  !code/allocation/variable to the -optimizations flag in the config file, and it managed to create the package without errors.

It is also mentioned here
Sign in to add a comment

Powered by Google Project Hosting