Google Drive API doesn’t play well with ProGuard (NPE)

A combination of the following has worked for me:

-keep class com.google.** { *;}
-keep interface com.google.** { *;}
-dontwarn com.google.**

-dontwarn sun.misc.Unsafe
-dontwarn com.google.common.collect.MinMaxPriorityQueue
-keepattributes *Annotation*,Signature
-keep class * extends com.google.api.client.json.GenericJson {
*;
}
-keep class com.google.api.services.drive.** {
*;
}

This provided a working proguard compatible solution for a recent Google Drive project.

Cannot take all credit for this solution though, originally found at this link here

Leave a Comment