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

為{幸葍}努か 提交于 2019-11-27 13:19:25

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

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

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

-optimizationpasses 5

to

-optimizationpasses 2

mikeflores2000

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"

I just fixed this issue by downloading the the R11 installer from http://dl.google.com/android/installer_r11-windows.exe and replacing the \tools directory with this one:
Run the downloaded installer.
Specify a different destination folder than the regular install and click through to Install.
At then end you can uncheck "Start SDK Manager...", and click [Finish].
The installer will create a \tools directory in that different folder.
Rename your regular "\android-sdk-windows\tools" directory, and copy that \tools directory to your regular "\android-sdk-windows\" directory.
The project should now build without the "Error 1".
I haven't looked into what is different in the 2 directories yet.

Changing proguard.bat as suggested didn't help in my case. Upgrading to proguard 4.6 also didn't help. What helped me is that I had to downgrade to Android SDK tools to revision 11. Note: when running SDK Manager and installing packages, I didn't install package "Android SDK Tools, revision 12".

UPDATE:

I have tried with Android SDK revision 15, but the issue is still present. Now this workaround of downgrading to revision 11 does not work any more, as URL that SDK Manager is using to download packages is not working any more.

After 2 days of trying different solutions, upgrading to proguard 4.6 did help.

It worked for me. As suggested by Michiel i replaced the proguard.bat from proguard 4.6 and now i am able to export the signed application without the error. Thanks mate.

Arsalan Shahid

Android SDK Tools Rev 16 ships with ProGuard 4.4 which has this problem. I upgraded to 4.7 by replacing the files in the android-sdk\tools\proguard folder and that fixed the problem for me.

Thanks

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!