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

后端 未结 6 854
渐次进展
渐次进展 2020-11-30 04:06

Currently, I\'m having experience that, a piece of code, which makes use of Google Drive API is running fine without introducing ProGuard.

However,

6条回答
  •  抹茶落季
    2020-11-30 04:38

    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

提交回复
热议问题