Android Proguard 警告 : can't write resource (Duplicate zip entry)

标签 android android-proguard

我启用了 proguard 并得到:

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 [commons-io-2.4.jar:META-INF/NOTICE.txt])
Warning:can't write resource [META-INF/LICENSE.txt] (Duplicate zip entry [commons-collections-3.2.1.jar:META-INF/LICENSE.txt])
Warning:can't write resource [META-INF/NOTICE.txt] (Duplicate zip entry [commons-collections-3.2.1.jar:META-INF/NOTICE.txt])
Warning:can't write resource [META-INF/LICENSE.txt] (Duplicate zip entry [joda-time-2.7-no-tzdb.jar:META-INF/LICENSE.txt])
Warning:can't write resource [META-INF/NOTICE.txt] (Duplicate zip entry [joda-time-2.7-no-tzdb.jar:META-INF/NOTICE.txt])
Warning:can't write resource [META-INF/LICENSE.txt] (Duplicate zip entry [commons-primitives-1.0.jar:META-INF/LICENSE.txt])
Warning:can't write resource [META-INF/services/javax.annotation.processing.Processor] (Duplicate zip entry [icepick-processor-2.3.6.jar:META-INF/services/javax.annotation.processing.Processor])
Warning:can't write resource [.readme] (Duplicate zip entry [classes.jar:.readme])
Warning:can't write resource [META-INF/LICENSE.txt] (Duplicate zip entry [commons-lang-2.6.jar:META-INF/LICENSE.txt])
Warning:can't write resource [META-INF/NOTICE.txt] (Duplicate zip entry [commons-lang-2.6.jar:META-INF/NOTICE.txt])

这是什么意思? 我应该排除类似这里的东西吗?

configurations {
    all*.exclude group: 'commons-logging', module: 'commons-logging'
}

最佳答案

您正在使用包含重复文件的库,这是 gradle 中的一个错误,解决在您的项目 build.gradle 中使用此问题

android {
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude '.readme'
    }
}

关于Android Proguard 警告 : can't write resource (Duplicate zip entry),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30602599/

相关文章:

java - 从弹出窗口获取单选按钮值到 TextView

android - 混淆器警告 : can't write resource (Duplicate zip entry)

android - Proguard删除方法参数

Android - 缩小应用程序在 com.android.dex.util.ExceptionWithContext 中创建错误(名称已添加 : string {"a"})

android - 什么是最安全,最简单,最通用的proguard配置?

android - 如何使用proguard牙签规则?

android - 功能点击监听器问题android GeoJsonLayer

android - RecyclerView 不能应用于 FlexboxLayoutManager

javascript - 如何在 cordova/phonegap 应用程序中截取屏幕截图

android - 谷歌地图不显示在 android 中