-6

当我应用proguard,然后在控制台中,得到以下错误。请解决我的问题。

在应用 progaurd 时解决重复的 zip 输入错误。

控制台错误:

注意:有 157 个重复的类定义。

      (http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
Warning:can't write resource [META-INF/LICENSE.txt] (Duplicate zip entry [commons-io-2.4.jar:META-INF/LICENSE.txt])
Warning:can't write resource [META-INF/NOTICE.txt] (Duplicate zip entry [httpmime-4.2.1.jar:META-INF/NOTICE.txt])
Warning:can't write resource [META-INF/LICENSE.txt] (Duplicate zip entry [httpmime-4.2.1.jar:META-INF/LICENSE.txt])

有人帮我解决这个proguard问题吗?我在谷歌搜索了很多,但仍然找不到任何合适的解决方案。提前致谢。

4

1 回答 1

2

由于您没有编写详细信息,因此我希望您使用 Android Studio 和 Gradle 作为构建系统。将此块添加到您的 android DSL:

packagingOptions {
    exclude '.readme'
    exclude 'LICENSE.txt'
    exclude 'README.txt'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/LICENSE.txt'
}

您不需要所有这些,但它会起作用。这基本上会阻止构建系统包含一些文件。在您的情况下,一些无用的文本文件。

于 2015-06-10T05:37:05.700 回答