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

Vic*_*cVu 5 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 *; }

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

Eri*_*une 8

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