0

我第一次尝试在我的 Android 项目中使用 ProGuard。

我有一些问题:

  1. 对于 /libs 文件夹中的 jar 文件,它们应该如何在proguard-project.txt?

    • -injars /libs/commons-lang3-3.1.jar
    • 或者
    • -libraryjars /libs/commons-lang3-3.1.jar
    • ?
  2. proguard-project.txt我是否必须在我的工作区中作为库项目的库中写下一些 内容?

  3. 我收到很多这样的警告或警告:

->

[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吗?

  1. 中的设置是否有一定的顺序proguard-project.txt
4

1 回答 1

2

您的其中一个库包含 org.xmlpull.v1 类的副本,即使它们已经存在于 Android 运行时中。您应该从库中删除这些类。无论如何,Android 运行时中的版本都会获得优先权。

参照。ProGuard 手册 > 疑难解答 >警告:库类 ... 取决于程序类 ...

于 2013-08-13T00:53:10.097 回答