Proguard 错误:未知选项“-optimizationpasses”
我的 Proguard 版本曾经在早期的 Android SDK(10 之前)中工作,但现在不再工作了,这是一个非常基本的错误 - 见下文:
C:\development\android-sdk-windows\tools\ant\main_rules.xml: 453:未知选项 文件“C:\Users\Richard\Desktop\CodeWordTEST\p”第 1 行中的“-optimizationpasses” roguard.cfg'
即 proguard 在第一行失败。 有趣的是,如果我删除“-optimizationpasses”命令,它会设法进一步通过混淆器选项,但随后在“-dontpreverify”上失败
,有些东西似乎发生了变化,所以我回到了基础知识。
我从命令行构建了一个项目,以获取默认的 build.xml 和 proguard.cfg 文件。
还是同样的错误。
环境:
Windows 7
ADT 版本:11.0.0.v201105251008-128486
Ant 1.8.1
环境中没有其他 Proguard环境路径
(=默认由 android cmd 行自动生成):
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,! field/,!class/merging/
等...
有什么想法可能导致问题吗?
提前致谢...
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...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
与 Android 文档 (developer.android.com/sdk/tools-notes.html) 相反,Ant 1.8 及以上版本还不够好:
使用 Ant 1.8.2。
如果有人知道 1.8 的原因.2 是必需的,我们很想知道。
干杯...
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...
这些错误表明您在某种程度上使用了非常旧的 ProGuard 版本(2004 年的 3.0 中引入了优化,2007 年的 4.0 中引入了预验证)。
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).