Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android SDK tools revision 12 has problem with Proguard => error conversion to Dalvik format failed with error 1 [duplicate]

I have just updated to Android SDK tools revision 12, immediately my application can't be exported with previous Proguard setting. I received the "Conversion to Dalvik format failed with error 1", the only library I use is "jcifs". I have tried cleaning and rebuilding, create a new project, and reassembling and I believe I have done almost anything I can read in the Internet. Is this a new bug from this new SDK? I suggest don't update for the time being if your project use Proguard.

UPDATE 1: I also tried to export a simple Hello application with proguard set, still the same message. It looks like something is broken with this version of SDK tool.

UPDATE 2: I have to delete the whole tools folder in SDK directory and copy a backup of SDK tools revision 11 into it. At least I can go back to work and export with proguard works again. I hope this information helps whoever in the same situation. I still have no idea what is going on though, hope someone can shed a light on this annoying issue.

UPDATE 3: I have reported this issue as a bug here: http://code.google.com/p/android/issues/detail?id=18359 hope someone takes a good look at the issue, until then you will be advised to stay out of this version if you are using Proguard in your development.

like image 294
Yongki Avatar asked Jul 07 '11 04:07

Yongki


4 Answers

The problem is caused by ProGuard command line in R12 in the file [Android SDK Installation Directory]\tools\proguard\bin\proguard.bat. 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
like image 163
Alan Avatar answered Oct 30 '22 21:10

Alan


I downloaded Proguard 4.6 and copied the contents of /lib and /bin into /tools/proguard/ which fixed the problem.

like image 3
Michiel Avatar answered Oct 30 '22 19:10

Michiel


The only solution i've found to this problem is to change, in proguard.cfg

-optimizationpasses 5

to

-optimizationpasses 2

like image 2
Jakob Eriksson Avatar answered Oct 30 '22 21:10

Jakob Eriksson


I encountered the same issue with Android SDK Tools Rev 16 attempting to export a signed application package from Helios Eclipse 3.6 on Mac OS X 10.7.2 for execution on a Samsung Galaxy Nexus 4.0.2 build ICL53F

Problem:

[2012-01-11 03:15:46 - Chapter 8 Where Am I] Proguard returned with error code 1. See console
[2012-01-11 03:15:46 - Chapter 8 Where Am I] proguard.ParseException: Unknown option '8' in argument number 9
[2012-01-11 03:15:46 - Chapter 8 Where Am I]    at proguard.ConfigurationParser.parse(ConfigurationParser.java:170)
[2012-01-11 03:15:46 - Chapter 8 Where Am I]    at proguard.ProGuard.main(ProGuard.java:491)

Solution:

cd /Applications/android-sdk-mac_x86/tools/proguard/bin

then modify file proguard.sh as follows:

# java -jar "$PROGUARD_HOME"/lib/proguard.jar "$@"
java -jar "$PROGUARD_HOME"/lib/proguard.jar "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8"
like image 2
mikeflores2000 Avatar answered Oct 30 '22 21:10

mikeflores2000