首先,对不起,如果这个话题已被回答,但我还没找到...
我是Android和Proguard的新手。在开发我的应用程序结束时,我想用proguard减小它的大小,当然。由于我在我的应用程序中使用谷歌api客户端的一些库,我已将它们添加为外部jar。
好吧,我的应用程序工作正常,没有通过proguard步骤,但当我尝试导出它,它开始我的头痛。很多警告,我不知道如何跳过或安排。这样的东西:
[2012-03-05 07:20:06 - CollaJoveThreads] Proguard returned with error code 1. See console
[2012-03-05 07:20:06 - CollaJoveThreads] Warning: com.google.common.base.Equivalence: can't find referenced class javax.annotation.Nullable
[2012-03-05 07:20:06 - CollaJoveThreads] Warning: com.google.common.base.Equivalence: can't find referenced class javax.annotation.Nullable
[2012-03-05 07:20:06 - CollaJoveThreads] Warning: com.google.common.base.Equivalence: can't find referenced class javax.annotation.Nullable
[2012-03-05 07:20:06 - CollaJoveThreads] Warning: com.google.common.base.Equivalences$Impl$1: can't find referenced class javax.annotation.Nullable
[2012-03-05 07:20:06 - CollaJoveThreads] Warning: com.google.common.base.Equivalences$Impl$1: can't find referenced class javax.annotation.Nullable
和更相似的。
我跟踪了Google开发人员的推荐,并将这些行添加到我的proguard.cfg中:
# Needed by google-api-client to keep generic types and @Key annotations accessed via reflection
-keepclassmembers class * {
@com.google.api.client.util.Key <fields>;
}
-keepattributes Signature,RuntimeVisibleAnnotations,AnnotationDefault,*Annotation*
-dontwarn sun.misc.Unsafe
但它继续出现所有这些警告信息。当我尝试使用'-dontwarn'选项时,我的应用程序崩溃了。
我已经阅读了这些问题,还有更多:
有人可以帮忙吗?