Proguard ParseException:“在'keepdescriptorclasses''-Keep之前期待关键字'allowshrinking','allowoptimization'或'allowobfuscation'

时间:2014-09-08 20:01:37

标签: android proguard

从Android Studio

运行Proguard步骤时仅弹出的奇怪错误

错误:

org.gradle.internal.UncheckedException: proguard.ParseException: Expecting keyword 'allowshrinking', 'allowoptimization', or 'allowobfuscation' before 'includedescriptorclasses' in line 42 of file...

以下是我的Proguard文件中的相关行:

-keep, includedescriptorclasses public class com.Foo.Bar { public protected <fields>; public protected <methods>; public protected *; }

注意到:

-keep,allowobfuscations, allowoptimizations, allowshrinking, includedescriptorclasses public class com.Foo.Bar { public protected <fields>; public protected <methods>; public protected *; }

或者保持修饰符的任何组合仍然会导致相同的错误消息。

1 个答案:

答案 0 :(得分:8)

选项includedescriptorclasses是ProGuard 5.0中的新功能。您可能正在使用旧版本。这些版本都是向后兼容的,因此您只需更改ProGuard jar。