Android Proguard 警告:无法写入资源(重复的 zip 条目)

2024-03-29

我启用了 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'
    }
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Android Proguard 警告:无法写入资源(重复的 zip 条目) 的相关文章

随机推荐