开发者

Proguard error : Unknown option '-optimizationpasses'

My Proguard builds used to work in earlier Android SDKs (pre-10), but not any more, and its a very basic error - see below:

C:\development\android-sdk-windows\tools\ant\main_rules.xml:453: Unknown option '-optimizationpasses' in line 1 of 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 manages to go a little further through the proguard options, but then fails on '-dontpreverify'

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

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

Still the same error.

Environment:

  • Windows 7

  • ADT Version: 11.0.0.v201105251008-128486

  • Ant开发者_开发问答 1.8.1

  • no other Proguard in the env path

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

-optimizationpasses 5

-dontusemixedcaseclassnames

-dontskipnonpubliclibraryclasses

-dontpreverify

-verbose

-optimizations !code/simplification/arithmetic,!field/,!class/merging/

etc...

Any ideas what might be causing the problem?

Thanks in advance...


Contrary to the Android docs (developer.android.com/sdk/tools-notes.html), Ant 1.8 onwards isn't good enough:

Use Ant 1.8.2.

If anyone knows the reason why 1.8.2 is required, we'd love to know. Cheers...


The errors suggest that you were somehow using a very old version of ProGuard (optimization was introduced in 3.0 in 2004, preverification in 4.0 in 2007).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜