草庐IT

android - Proguard ParseException : "Expecting keyword ' allowshrinking', 'allowoptimization' 或 'allowobfuscation' 之前的 'includedescriptorclasses"' on -Keep

coder 2023-12-10 原文

仅在从 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。

关于android - Proguard ParseException : "Expecting keyword ' allowshrinking', 'allowoptimization' 或 'allowobfuscation' 之前的 'includedescriptorclasses"' on -Keep,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25732228/

有关android - Proguard ParseException : "Expecting keyword ' allowshrinking', 'allowoptimization' 或 'allowobfuscation' 之前的 'includedescriptorclasses"' on -Keep的更多相关文章

随机推荐