首先,對不起,如果這個話題已回答了,但我還沒有找到它......Proguard的Android和谷歌API客戶端
我是新與Android和Proguard的。在開發我的應用程序時,我想用proguard來縮小它的大小,當然。正如我在我的應用程序中使用一些來自google api客戶端的庫,我已經將它們添加爲外部罐子。
那麼,我的應用程序工作正常,沒有通過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
和更多類似。
我按照谷歌開發者recomendations,並添加此行我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
但它仍然出現這些警告消息。當我嘗試使用'-twtwarn'選項時,我的應用程序崩潰。
我已經閱讀了這些問題,更多:
誰能幫助?
對不起,我發現它:缺少'jsr305-1.3.9'jar文件(我以前沒有意識到)。感謝所有。 – emiquelgavalda 2012-03-06 12:21:29