Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I enabled proguard and got:

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])

What does it mean? Should I exclude something like here?

configurations {
    all*.exclude group: 'commons-logging', module: 'commons-logging'
}
like image 708
Daniel Gomez Rico Avatar asked Jun 02 '15 17:06

Daniel Gomez Rico


1 Answers

You are using a library with duplicate files, is a bug in gradle, for solve use this in your project build.gradle

android {
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude '.readme'
    }
}
like image 197
Santiago Avatar answered Sep 22 '22 09:09

Santiago