My favorites | Sign in
Project Home Issues
New issue   Search
for
  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 androxpl...@gmail.com, Jul 9, 2011
If you enable proguard.config in default.properties 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
#1 ayl...@gmail.com
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.

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


Jul 11, 2011
#2 androxpl...@gmail.com
I can confirm that the work around works. Thanks!
Jul 13, 2011
#3 sakam...@securesky-tech.com
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
#5 ma2nao...@gmail.com
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
#6 ran.ma...@gmail.com
comment 1 worked for me as well.
Jul 19, 2011
#7 girish.h...@gmail.com
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.

Error.png
20.7 KB   View   Download
Jul 27, 2011
#8 leewc6...@gmail.com
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
#9 webnet.a...@gmail.com
Proguard update to 4.6 (r12 comes with 4.4) solves the issue here too.
Jul 31, 2011
#10 mport...@gmail.com
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
#11 i.am.iriax@gmail.com
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.

Steps:
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
#12 prateeka...@gmail.com
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
#13 deshpand...@gmail.com
Changed as described
call %java_exe% -jar "%PROGUARD_HOME%"\lib\proguard.jar %*
to
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
#15 p...@jaxo.com
Following the advice on comment #1 (editing the .bat file) worked for me.
Aug 15, 2011
#16 elseRet...@gmail.com
only updating to proguare 4.6, worked for me
Aug 25, 2011
#17 npeer2...@gmail.com
Updated to ProGuard 4.6 and the problem went away.
Aug 25, 2011
#18 sjbarb...@gmail.com
I also updated to ProGuard 4.6 per Comment 5 and this resolved the issue for
me.
Sep 8, 2011
#20 johan.na...@gmail.com
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
#21 sasa.ske...@gmail.com
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
#22 michiel....@gmail.com
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
#23 jligerof...@gmail.com
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
#24 MartyMacGyver@gmail.com
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 http://sourceforge.net/projects/proguard/files/proguard/4.6/ , 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
#25 calin.gr...@gmail.com
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
#28 mail4gha...@gmail.com
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
#29 sasa.ske...@gmail.com
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
#30 kmans...@gmail.com
This is still broken in ADT r14.

What's worse, Eclipse now ignores proguard.dir in local.properties - 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
#31 pk.sam...@gmail.com
(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 r...@android.com
(No comment was entered for this change.)
Status: Unassigned
Cc: to...@android.com r...@android.com
Labels: Component-Tools
Nov 29, 2011
Project Member #33 r...@android.com
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
#34 toco...@gmail.com
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
#35 mritun@gmail.com
I can confirm that upgrading to 4.6 by replacing contents of bin and lib fixed the issue for me.
Dec 29, 2011
#36 ykelane...@gmail.com
upgrading to 4.6 fixed it for me, too. Thanks a lot.
Jan 12, 2012
Project Member #37 tnor...@google.com
We're bundling ProGuard 4.7 with ADT 17, which should fix this issue.
Status: FutureRelease
Owner: tnor...@google.com
Labels: Target-r17
Jan 17, 2012
#38 marco.d....@gmail.com
WOOOOW worked for me too! from proguard 4.4 to 4.7
Jan 25, 2012
#39 iz.niko...@gmail.com
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
#41 rasanga...@gmail.com
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
#42 cantemir...@gmail.com
comment 41 did helped a lot! I was updating to 4.6 a different folder :)
Jan 31, 2012
#43 taw...@gmail.com
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
#44 mdlit...@gmail.com
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
#45 mathlusi...@gmail.com
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 tnor...@google.com
Fixed in ADT 17, now released.
Status: Released
Mar 24, 2012
#47 binaryt...@gmail.com
I fixed this problem on ADT 12
Yesterday updated to ADT 17 - the error come back again! Unbelievable.... 
Mar 24, 2012
#48 Maralb@gmail.com
I've just updated to ADT 17... and i've again the problem...
Mar 24, 2012
Project Member #49 tnor...@google.com
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: http://tools.android.com/recent/dealingwithdependenciesinandroidprojects )

Mar 24, 2012
#50 girish.h...@gmail.com
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
#51 girish.h...@gmail.com
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
#52 zacpros...@gmail.com
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
#53 zacpros...@gmail.com
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
#54 kevin.br...@gmail.com
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
#55 kevin.br...@gmail.com
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
#56 jarev...@ntrglobal.com
@comment 55
where did you added this !code/allocation/variable  line?
Jun 14, 2012
#57 manolo.t...@gmail.com
this is getting worst. Is there any solution?
Jul 20, 2012
#58 amfsouza...@gmail.com
Guys, I restarted windows and the issue was fixed.
Jul 20, 2012
#59 amfsouza...@gmail.com
Sorry, restarted and did a clean up. Is working fine right now.
Jul 24, 2012
#60 tulasipe...@gmail.com
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
#61 At.stefa...@gmail.com
Updated proguard is the only solution ;)
Apr 24, 2013
#62 shinhals...@gmail.com
Same error, same fix.  Updated to proguard 4.9.  Just download proguard and replace the directory in the SDK.
Aug 5, 2013
#63 pari...@gmail.com
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
https://code.google.com/p/android/issues/detail?id=29258
Sign in to add a comment

Powered by Google Project Hosting