只有在从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 *;
}
或者keep修饰符的任何组合仍然会导致相同的错误消息。
选项includedescriptorclasses
在ProGuard 5.0中是新的。您可能正在使用旧版本。这些版本都是向后兼容的,所以您只需更改ProGuard jar即可。