简体   繁体   中英

Parse SDK Android Proguard issue

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)

In my proguard.cfg I have the following:

-keepattributes *Annotation*
-keep class com.parse.* { *; } 
-libraryjars libs/Parse-1.5.1.jar 

This is driving me crazy!!!

You should try also keeping the subpackages of com.parse:

-keepattributes *Annotation*
-keep class com.parse.** { *; }

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.

Mine was fixed by adding this:

-keep class com.parse.* { *; }
-dontwarn com.parse.**

Reference: this post .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM