Proguard Error: Unknown option '-optimizationpasses'

My Proguard builds are used to work in earlier versions of the Android SDK (up to 10), but no more, and its a very simple error - see below:

C: \ development \ android-sdk-windows \ tools \ ant \ main_rules.xml: 453: Unknown parameter '-optimizationpasses' on line 1 of the file' C: \ Users \ Richard \ Desktop \ CodeWordTEST \ p roguard.cfg

i.e. proguard fails on the first line. Interestingly, if I remove the '-optimizationpasses' command, it will be able to advance a bit in the proguard parameters, but then it will fail to execute the '-dontpreverify'

Something seems to have changed, so I went back to the basics.

I built the project from the command line to get the default files build.xml and proguard.cfg.

Still the same error.

Environment:

  • Windows 7

  • ADT Version: 11.0.0.v201105251008-128486

  • Ant 1.8.1

  • no other proguard in env way

proguard.cfg contents (= default as automatically generated by cmd android line):

-optimizationpasses 5

-dontusemixedcaseclassnames

-dontskipnonpubliclibraryclasses

-dontpreverify

-verbose

-optimization! code / simplification / arithmetic ,! field /, class / merge /

etc...

Any ideas that might cause the problem?

Thanks in advance...

+4
source share
2 answers

Unlike Android docs (developer.android.com/sdk/tools-notes.html), Ant 1.8 is not good enough:

Use Ant 1.8.2.

If anyone knows the reason why 1.8.2 is required, we would like to know. Greetings ...

+1
source

Errors suggest that you somehow used a very old version of ProGuard (optimization was introduced in 3.0 in 2004, preliminary check in 4.0 in 2007).

+1
source

All Articles