这个是proguard-project.txt文件。
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
-keep class com.hifosurvey.view.PhotoUpdateFailureActivity{*;}
-keep class com.nosurvey.view.HistorySurveyActivity{*;}
-keep class com.nosurvey.view.NoSurveyViewActivity{*;}
# Add any project specific keep options here:
-libraryjars libs/android-support-v4.jar
-libraryjars libs/baidumapapi_v3_3_0.jar
-libraryjars libs/commons-net-3.1.jar
-libraryjars libs/gson-2.1-javadoc.jar
-libraryjars libs/gson-2.1-sources.jar
-libraryjars libs/gson-2.1.jar
-libraryjars libs/JToolSimple.jar
-libraryjars libs/ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar
-libraryjars libs/locSDK_5.01.jar
-libraryjars libs/nineoldanimatin.jar
-libraryjars libs/pushservice-4.3.0.4.jar
-libraryjars libs/universal-image-loader-1.9.4.jar
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
-dontwarn com.baidu.**
-keep class com.baidu.** { *;}
然后打包的时候就出现这种问题,不知道怎么解决。
[2015-07-24 10:28:51 - HiFoSurvey] Proguard returned with error code 1. See console
[2015-07-24 10:28:51 - HiFoSurvey] Note: there were 1685 duplicate class definitions.
[2015-07-24 10:28:51 - HiFoSurvey] Warning: library class android.content.res.XmlResourceParser extends or implements program class org.xmlpull.v1.XmlPullParser
[2015-07-24 10:28:51 - HiFoSurvey] Warning: com.handmark.pulltorefresh.library.internal.ViewCompat$SDK16: can't find referenced method 'void postOnAnimation(java.lang.Runnable)' in class android.view.View
[2015-07-24 10:28:51 - HiFoSurvey] Warning: com.handmark.pulltorefresh.library.internal.ViewCompat$SDK16: can't find referenced method 'void setBackground(android.graphics.drawable.Drawable)' in class android.view.View
[2015-07-24 10:28:51 - HiFoSurvey] Warning: library class android.content.Intent depends on program class org.xmlpull.v1.XmlPullParser
[2015-07-24 10:28:51 - HiFoSurvey] Warning: library class android.content.IntentFilter depends on program class org.xmlpull.v1.XmlSerializer
[2015-07-24 10:28:51 - HiFoSurvey] Warning: library class android.content.IntentFilter depends on program class org.xmlpull.v1.XmlPullParser
[2015-07-24 10:28:51 - HiFoSurvey] Warning: library class android.content.res.ColorStateList depends on program class org.xmlpull.v1.XmlPullParser
[2015-07-24 10:28:51 - HiFoSurvey] Warning: library class android.graphics.drawable.AnimationDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2015-07-24 10:28:51 - HiFoSurvey] Warning: library class android.graphics.drawable.ColorDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2015-07-24 10:28:51 - HiFoSurvey] Warning: library class android.graphics.drawable.Drawable depends on program class org.xmlpull.v1.XmlPullParser
[2015-07-24 10:28:51 - HiFoSurvey] Warning: library class android.graphics.drawable.Drawable depends on program class org.xmlpull.v1.XmlPullParser
[2015-07-24 10:28:51 - HiFoSurvey] Warning: library class android.graphics.drawable.Drawable depends on program class org.xmlpull.v1.XmlPullParser
[2015-07-24 10:28:51 - HiFoSurvey] Warning: library class android.graphics.drawable.GradientDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2015-07-24 10:28:51 - HiFoSurvey] Warning: library class android.graphics.drawable.InsetDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2015-07-24 10:28:51 - HiFoSurvey] Warning: library class android.graphics.drawable.NinePatchDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2015-07-24 10:28:51 - HiFoSurvey] Warning: library class android.util.Xml depends on program class org.xmlpull.v1.XmlPullParser
[2015-07-24 10:28:51 - HiFoSurvey] Warning: library class android.util.Xml depends on program class org.xmlpull.v1.XmlSerializer
[2015-07-24 10:28:51 - HiFoSurvey] Warning: library class android.util.Xml depends on program class org.xmlpull.v1.XmlPullParser
[2015-07-24 10:28:51 - HiFoSurvey] Warning: library class android.view.LayoutInflater depends on program class org.xmlpull.v1.XmlPullParser
[2015-07-24 10:28:51 - HiFoSurvey] Warning: library class android.view.LayoutInflater depends on program class org.xmlpull.v1.XmlPullParser
[2015-07-24 10:28:51 - HiFoSurvey] You should check if you need to specify additional program jars.
[2015-07-24 10:28:51 - HiFoSurvey] Warning: there were 18 instances of library classes depending on program classes.
[2015-07-24 10:28:51 - HiFoSurvey] You must avoid such dependencies, since the program classes will
[2015-07-24 10:28:51 - HiFoSurvey] be processed, while the library classes will remain unchanged.
[2015-07-24 10:28:51 - HiFoSurvey] Warning: there were 2 unresolved references to program class members.
[2015-07-24 10:28:51 - HiFoSurvey] Your input classes appear to be inconsistent.
[2015-07-24 10:28:51 - HiFoSurvey] You may need to recompile them and try again.
[2015-07-24 10:28:51 - HiFoSurvey] Alternatively, you may have to specify the option
[2015-07-24 10:28:51 - HiFoSurvey] '-dontskipnonpubliclibraryclassmembers'.
[2015-07-24 10:28:51 - HiFoSurvey] java.io.IOException: Please correct the above warnings first.
[2015-07-24 10:28:51 - HiFoSurvey] at proguard.Initializer.execute(Initializer.java:321)
[2015-07-24 10:28:51 - HiFoSurvey] at proguard.ProGuard.initialize(ProGuard.java:211)
[2015-07-24 10:28:51 - HiFoSurvey] at proguard.ProGuard.execute(ProGuard.java:86)
[2015-07-24 10:28:51 - HiFoSurvey] at proguard.ProGuard.main(ProGuard.java:492)
有之道的大神帮忙解决下。
1 个解决方案
#1
-dontwarn org.xmlpull.v1.**
-keep class org.xmlpull.v1.** { *;}
-keep class org.xmlpull.v1.** { *;}
#1
-dontwarn org.xmlpull.v1.**
-keep class org.xmlpull.v1.** { *;}
-keep class org.xmlpull.v1.** { *;}