4

我目前在启用 proguard 时导出应用程序,问题是应用程序工作正常,但应用程序在没有 proguard 的情况下部署,但如果在启用 proguard 时导出和部署,应用程序会出现错误,即 Internet 未连接。以下是proguard文件文本

-dontshrink
-dontoptimize
-dontwarn com.example.google.tv.**
-dontwarn android.support.**
-dontwarn org.ksoap.**
-dontwarn android.view.**
-dontwarn android.graphics.**
-dontwarn android.content.**
-dontwarn android.util.**
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
#-libraryjars libs/ksoap2-android-assembly-2.5.2-jar-with-dependencies.jar
#-libraryjars libs/android-support-v4.jar

如果我删除

-dontwarn android.view.**
-dontwarn android.graphics.**
-dontwarn android.content.**
-dontwarn android.util.**

那么这是我收到的日志

[2013-08-02 10:29:04 - Project] Proguard returned with error code 1. See console
[2013-08-02 10:29:04 - Project] Note: there were 4 duplicate class definitions.
[2013-08-02 10:29:04 - Project] Warning: library class android.content.res.XmlResourceParser extends or implements program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project] Warning: library class android.content.Intent depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project] Warning: library class android.content.IntentFilter depends on program class org.xmlpull.v1.XmlSerializer
[2013-08-02 10:29:04 - Project] Warning: library class android.content.IntentFilter depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project] Warning: library class android.content.res.ColorStateList depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project] Warning: library class android.graphics.drawable.BitmapDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project] Warning: library class android.graphics.drawable.ColorDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project] Warning: library class android.graphics.drawable.Drawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project] Warning: library class android.graphics.drawable.Drawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project] Warning: library class android.graphics.drawable.Drawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project] Warning: library class android.graphics.drawable.LayerDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project] Warning: library class android.view.LayoutInflater depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project] Warning: library class android.view.LayoutInflater depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-02 10:29:04 - Project]       You should check if you need to specify additional program jars.
[2013-08-02 10:29:04 - Project] Warning: there were 13 instances of library classes depending on program classes.
[2013-08-02 10:29:04 - Project]          You must avoid such dependencies, since the program classes will
[2013-08-02 10:29:04 - Project]          be processed, while the library classes will remain unchanged.
[2013-08-02 10:29:04 - Project] java.io.IOException: Please correct the above warnings first.
[2013-08-02 10:29:04 - Project]     at proguard.Initializer.execute(Initializer.java:321)
[2013-08-02 10:29:04 - Project]     at proguard.ProGuard.initialize(ProGuard.java:211)
[2013-08-02 10:29:04 - Project]     at proguard.ProGuard.execute(ProGuard.java:86)
[2013-08-02 10:29:04 - Project]     at proguard.ProGuard.main(ProGuard.java:492)
4

1 回答 1

1

org.xmlpull.v1您应该从您的库中删除该软件包。它已经存在于 Android 运行时中(无论如何都会优先)。添加重复的包最多会增加应用程序的大小,最坏的情况可能会导致版本控制问题。在这种情况下,ProGuard 会检测到一些依赖冲突。

请注意,这是“ProGuard”,而不是“Progaurd”。

于 2013-08-03T09:41:52.930 回答