本文介绍了解析SDK的Android Proguard的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我分析我的应用程序1.5.1,一切工作正常,但是当我去出口APK我得到:
I have parse 1.5.1 in my app and everything works fine, but when I go to export to APK I get:
[2014-09-05 19:53:08 - myapp] Proguard returned with error code 1. See console
[2014-09-05 19:53:08 - myapp] Note: there were 662 duplicate class definitions.
[2014-09-05 19:53:08 - myapp] Warning: com.parse.FacebookAuthenticationProvider$1: can't find superclass or interface com.facebook.android.Facebook$ServiceListener
[2014-09-05 19:53:08 - myapp] Warning: com.parse.FacebookAuthenticationProvider$2: can't find superclass or interface com.facebook.Session$StatusCallback
[2014-09-05 19:53:08 - myapp] Warning: com.parse.FacebookAuthenticationProvider$2$1: can't find superclass or interface com.facebook.Request$Callback
[2014-09-05 19:53:08 - myapp] Warning: com.parse.FacebookAuthenticationProvider: can't find referenced class com.facebook.android.Facebook
......
[2014-09-05 19:53:08 - myapp] at proguard.Initializer.execute(Initializer.java:321)
[2014-09-05 19:53:08 - myapp] at proguard.ProGuard.initialize(ProGuard.java:211)
[2014-09-05 19:53:08 - myapp] at proguard.ProGuard.execute(ProGuard.java:86)
[2014-09-05 19:53:08 - myapp] at proguard.ProGuard.main(ProGuard.java:492)
在我proguard.cfg我有以下几点:
In my proguard.cfg I have the following:
-keepattributes *Annotation*
-keep class com.parse.* { *; }
-libraryjars libs/Parse-1.5.1.jar
这是推动我疯了!
推荐答案
您应该尝试也保持com.parse的子包:
You should try also keeping the subpackages of com.parse:
-keepattributes *Annotation*
-keep class com.parse.** { *; }
您不应该添加 -libraryjars
选项,因为Android的构建过程中已经自动指定了所有必要的 -injars
, -outjars
和 -libraryjars
为您服务。它不仅会导致关于重复类的警告。
You should not add -libraryjars
options, since the Android build process already automatically specifies all necessary -injars
, -outjars
, and -libraryjars
for you. It only causes warnings about duplicate classes.
这篇关于解析SDK的Android Proguard的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!