Proguard with Duplicate Zip entry error

By : dipali
Source: Stackoverflow.com
Question!

When I applied proguard, then in console ,getting below error.please solve my issue.

solve duplicate zip entry error while applying progaurd.

Console Error:

Note: there were 157 duplicate class definitions.

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

Anyone help me regarding this proguard problem? I have searched a lot in google, but still can't find any proper solution. Thanks in advance.

By : dipali


Answers

Since you don't write the details I expect that you are using Android Studio and Gradle as build system. Add to your android DSL this block:

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'
}

You do not need all of them but it will work. This basically blocks the build system to include some files. In your case some useless text files.

By : rekire


This video can help you solving your question :)
By: admin