Looking for a ProGuard configuration for Guava that will obfuscate and optimize, as the default one that is provided on the website does not.
Not only that I cannot
These proguard-rules worked for me: guava 23.3-android
-dontwarn sun.misc.Unsafe
-dontwarn com.google.common.collect.MinMaxPriorityQueue
-dontwarn com.google.common.util.concurrent.FuturesGetChecked**
-dontwarn javax.lang.model.element.Modifier
Total proguard rule for guava 20.0. For now the latest guava 21 does not support android.
-dontwarn com.google.common.base.**
-keep class com.google.common.base.** {*;}
-dontwarn com.google.errorprone.annotations.**
-keep class com.google.errorprone.annotations.** {*;}
-dontwarn com.google.j2objc.annotations.**
-keep class com.google.j2objc.annotations.** { *; }
-dontwarn java.lang.ClassValue
-keep class java.lang.ClassValue { *; }
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-keep class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement { *; }
Now that Guava 19.0 is released, I found that I had to add these rules.
-keep class com.google.j2objc.annotations.** { *; }
-dontwarn com.google.j2objc.annotations.**
-keep class java.lang.ClassValue { *; }
-dontwarn java.lang.ClassValue
-keep class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement { *; }
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
This message suggests the following workaround:
-dontwarn com.google.common.collect.MinMaxPriorityQueue
I'd like to think that Proguard could be changed to make this unnecessary, but we haven't checked with its owners.