ProGuard无法找到引用的库

时间:2014-07-15 18:31:39

标签: android facebook parse-platform proguard

[2014-07-15 23:57:43 - MozMeet] Proguard returned with error code 1. See console
[2014-07-15 23:57:43 - MozMeet] Note: there were 662 duplicate class definitions.
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$1: can't find superclass or interface com.facebook.android.Facebook$ServiceListener
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2: can't find superclass or interface com.facebook.Session$StatusCallback
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find superclass or interface com.facebook.Request$Callback
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$Builder
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$Builder
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$Builder
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.SharedPreferencesTokenCachingStrategy
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.SharedPreferencesTokenCachingStrategy
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$Builder
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$Builder
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$OpenRequest
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$OpenRequest
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$OpenRequest
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$OpenRequest
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$OpenRequest
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$OpenRequest
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.TokenCachingStrategy
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.TokenCachingStrategy
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.TokenCachingStrategy
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.TokenCachingStrategy
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.SessionState
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.TokenCachingStrategy
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.SessionState
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook$ServiceListener
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$StatusCallback
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.SessionDefaultAudience
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session$OpenRequest
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.TokenCachingStrategy
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.Session
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$1: can't find referenced class com.facebook.android.Facebook$ServiceListener
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$1: can't find referenced class com.facebook.android.Facebook
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$1: can't find referenced class com.facebook.android.FacebookError
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$1: can't find referenced class com.facebook.android.FacebookError
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.SessionState
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.SessionState
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Request
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Request
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Request
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Session$StatusCallback
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.SessionState
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Request
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Session
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Request$Callback
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Session
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.SessionState
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Request
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.Session
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2: can't find referenced class com.facebook.SessionState
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.Response
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.FacebookRequestError
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.Response
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.model.GraphObject
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.Request$Callback
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.Response
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.FacebookRequestError
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.model.GraphObject
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.Request
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.Response
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find referenced class com.facebook.Response
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.ParseFacebookUtils: can't find referenced class com.facebook.Session
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.ParseFacebookUtils: can't find referenced class com.facebook.Session
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.ParseFacebookUtils: can't find referenced class com.facebook.android.Facebook
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.ParseFacebookUtils: can't find referenced class com.facebook.Session
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.ParseFacebookUtils: can't find referenced class com.facebook.android.Facebook
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.ParseFacebookUtils: can't find referenced class com.facebook.android.Facebook
[2014-07-15 23:57:43 - MozMeet] Warning: com.parse.ParseFacebookUtils: can't find referenced class com.facebook.Session
[2014-07-15 23:57:43 - MozMeet] Warning: com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient
[2014-07-15 23:57:43 - MozMeet] Warning: com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient
[2014-07-15 23:57:43 - MozMeet] Warning: com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkUrlFactory
[2014-07-15 23:57:43 - MozMeet] Warning: com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Cache
[2014-07-15 23:57:43 - MozMeet] Warning: com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.Cache
[2014-07-15 23:57:43 - MozMeet] Warning: com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient
[2014-07-15 23:57:43 - MozMeet] Warning: com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkUrlFactory
[2014-07-15 23:57:43 - MozMeet] Warning: com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkUrlFactory
[2014-07-15 23:57:43 - MozMeet] Warning: com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkUrlFactory
[2014-07-15 23:57:43 - MozMeet] Warning: com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkUrlFactory
[2014-07-15 23:57:43 - MozMeet] Warning: com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient
[2014-07-15 23:57:43 - MozMeet] Warning: com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient
[2014-07-15 23:57:43 - MozMeet] Warning: com.squareup.picasso.OkHttpDownloader: can't find referenced class com.squareup.okhttp.OkHttpClient
[2014-07-15 23:57:43 - MozMeet]       You should check if you need to specify additional program jars.
[2014-07-15 23:57:43 - MozMeet] Warning: there were 95 unresolved references to classes or interfaces.
[2014-07-15 23:57:43 - MozMeet]          You may need to specify additional library jars (using '-libraryjars').
[2014-07-15 23:57:43 - MozMeet] Error: Please correct the above warnings first.  

这是我在尝试导出启用了ProGuard的Android应用时获得的错误列表。一点谷歌搜索,我发现我需要将jar文件添加到proguard-project.txt。到目前为止,我添加的内容看起来像这样(但无济于事):

-keepattributes SourceFile,LineNumberTable
-keep class com.parse.*{ *; }
-libraryjars \libs\Parse-1.5.1.jar
-keepclasseswithmembernames class * {
    native <methods>;
}  

我还有3个库以及Parse,即Crashlytics,Picasso和V4 Support。

1 个答案:

答案 0 :(得分:82)

proguard-project.txt文件进行了一些更改(如果项目中有多个模块 - 将其放在调用* .jar文件的模块中,则会收到警告):

-keepattributes SourceFile,LineNumberTable
-keep class com.parse.*{ *; }
-dontwarn com.parse.**
-dontwarn com.squareup.picasso.**
-keepclasseswithmembernames class * {
    native <methods>;
}  

需要-dontwarn行。基本上他们告诉ProGuard这些罐子本身就可以正常工作,所以当你找不到他们所引用的课程时,不要抱怨。