7

In my android application i have multiple third party libraries in libs folder

ex -: httpcore-4.2.4.jar , httpmime-4.2.5.jar,twitter4j-core-4.0.1.jar

these libraries are not duplicated and i'm pretty sure with that , but when i create the proguard release i get this error

(Duplicate zip entry [twitter4j-core-4.0.1.jar:META-INF/MANIFEST.MF])
.... (This error occurs for all of the library(libs)

I refereed this link to overcome with issue , i tried every option of it , but no luck with that ,

Proguard warnings "can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry)"

Is there any way to specify filters on the input jar

Community
  • 1
  • 1
Mr.G
  • 1,275
  • 1
  • 18
  • 48
  • One of those 7 options would work - when you tried them did the error message change from twitter4j to something else? – Blundell Oct 27 '14 at 11:56
  • You missed out very important information. Which build system you are using! Gradle? Which pro gurard version you are using. What is your ADT Build Tools Version etc please give these information. try updating your tools – AZ_ Oct 28 '14 at 09:58

1 Answers1

2

Your libraries are not duplicated, but some info files inside of several libraries are.

The best solution is to include in your build.gradle. inside the "android" section something like this:

android{
 packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LGPL2.1'

    }
}

By the error message that you included here I will guess that adding this exclude will solve your problem:

exclude "META-INF/MANIFEST.MF"
Martin Revert
  • 3,242
  • 2
  • 30
  • 33