我第一次尝试在我的Android项目上使用ProGuard。
我有几个问题:
对于/ libs文件夹中的jar文件,如何在proguard-project.txt
中引用它们?
-injars /libs/commons-lang3-3.1.jar
-libraryjars /libs/commons-lang3-3.1.jar
我是否必须在proguard-project.txt
中为我工作区中的库项目库写下一些内容?
我得到了很多这样的警告:
- >
[2013-08-12 14:27:13 - xy.de] Warning: library class android.graphics.drawable.LayerDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-12 14:27:13 - xy.de] Warning: library class android.graphics.drawable.ShapeDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-12 14:27:13 - xy.de] Warning: library class android.graphics.drawable.ShapeDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-12 14:27:13 - xy.de] Warning: library class android.graphics.drawable.StateListDrawable depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-12 14:27:13 - xy.de] Warning: library class android.util.Xml depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-12 14:27:13 - xy.de] Warning: library class android.util.Xml depends on program class org.xmlpull.v1.XmlSerializer
[2013-08-12 14:27:13 - xy.de] Warning: library class android.util.Xml depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-12 14:27:13 - xy.de] Warning: library class android.view.LayoutInflater depends on program class org.xmlpull.v1.XmlPullParser
[2013-08-12 14:27:13 - xy.de] Warning: library class android.view.LayoutInflater depends on program class org.xmlpull.v1.XmlPullParser
那是什么? XmlPullParser是Android框架的一部分吗?它怎么会丢失?
4 ..
[2013-08-12 14:27:13 - bauen.de] Warning: there were 42 unresolved references to program class members.
[2013-08-12 14:27:13 - bauen.de] Your input classes appear to be inconsistent.
[2013-08-12 14:27:13 - bauen.de] You may need to recompile them and try again.
[2013-08-12 14:27:13 - bauen.de] Alternatively, you may have to specify the option
[2013-08-12 14:27:13 - bauen.de] '-dontskipnonpubliclibraryclassmembers'.
我应该真的设置-dontskipnonpubliclibraryclassmembers
吗?
proguard-project.txt
中的设置?答案 0 :(得分:2)
其中一个库包含org.xmlpull.v1类的副本,即使这些类已存在于Android运行时中。您应该从库中删除这些类。无论如何,Android运行时中的版本都会优先。
(CFR)。 ProGuard手册>疑难解答> Warning: library class ... depends on program class ...