Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proguard ParseException: "Expecting keyword 'allowshrinking', 'allowoptimization', or 'allowobfuscation' before 'includedescriptorclasses"' on -Keep

Weird error that only pops up when running the Proguard step from Android Studio

The error:

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

Here is the line in question in my Proguard file:

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

Noting that:

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

Or any combination of keep modifiers still results in the same error message.

like image 809
VicVu Avatar asked Sep 08 '14 20:09

VicVu


1 Answers

The option includedescriptorclasses is new in ProGuard 5.0. You are probably using an older version. The versions are all backward compatible, so you can just change the ProGuard jar.

like image 152
Eric Lafortune Avatar answered Nov 05 '22 07:11

Eric Lafortune