Proguard warnings can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry)
Possibly a 'proguard.cfg' problem. Does it include any '-injars'? If your project includes another project as a library, jars can be processed twice. Could you post your 'proguard.cfg'?
Extract from http://proguard.sourceforge.net/index.html#manual/troubleshooting.html:
Your input jars contain multiple resource files with the same name.
ProGuard continues copying the resource files as usual, skipping any
files with previously used names. Once more, the warning may be an
indication of some problem though, so it's advisable to remove the
duplicates. A convenient way to do so is by specifying filters on the
input jars. There is no option to switch off these warnings.
OPTION #1:
As you can't post your '-injars', check if they include either 'android-support-v13.jar' or the library included in your project which itself also includes 'android-support-v13.jar'.
Assuming you are building with Ant inside IntelliJ IDEA, you mustn't add -injars, -outjars, or -libraryjars options; the Ant script already does that for you.
OPTION #2:
Although the warnings are harmless, a clean build is a happy build, so try:
http://web.archive.org/web/20160206204259/http://www.dancartoon.com/2012/01/14/fixing-proguard-warning-cant-write-resource-meta-infmanifest-mf/
and
https://gist.github.com/paulpv/4439012
OPTION #3:
Include (!META-INF/MANIFEST.MF)
after each '-injars' command
-injars library.jar(!META-INF/MANIFEST.MF)
OPTION #4: Android Proguard Duplicate Definition
Fixed this by moving the 3rd party libraries to another directory, in
my case 'lib'. Then added-injars lib/jmdns.jar
to the proguard.cfg file.
OPTION #5: Android - Proguard duplicate zip entry error
If your Proguard config file includes the following line, remove it:
-injars bin/classes
OPTION #6: Android obfuscate app using proguard keeps obfuscating library jars - or is it?
I found another way to make Proguard leave library jars alone was to
ask it to preserve their package names, eg:-keep class javax.** { *; }
-keep class org.** { *; }
-keep class twitter4j.** { *; }
OPTION #7:
A weird solution (deleting META-INF folder in src folder) to something similar here.
Prograurd Duplicate zip entry
In addition to Jared’s answer, if you receive an error about a duplicate .class
file(s), not just the META-INF/
files, you may need to exclude the offending module that includes the duplicate .class
file(s).
You will need to identify which dependency is including the module with the duplicate .class
entries and exclude that module from said dependency.
You can use the Gradle command: ./gradlew app:dependencies
to list the complete dependency graph. Where “app:
” is the name of your project's module/app.
After using the ./gradlew app:dependencies
command you should look through the list of dependencies and find the one that is including the offending module with the duplicate .class
entries.
As an example, lets say that com.android.support:support-v4
is the module with the duplicate classes that are causing these errors. Here's how to exclude that duplicate module from your dependency:
//Your dependency that includes the module with the duplicates.
compile('com.my.project:my-module:0.1') {
//exclude the offending module so there won’t be duplicates.
exclude module: 'support-v4'
//maybe you need to exclude a group also?...
exclude group: 'com.google.android.gms'
}
Android - Proguard duplicate zip entry error
The Update 1 in the question has solved my problem and I am now able to run my application.
This answer is just to mark the question as answered which I can do after two days.
Related Topics
Is Arm64-V8A Compatible with Armeabi-V7A
Android Cardview Remove Padding
Setting Audio File as Ringtone
How Do Cursorloader Automatically Updates the View Even If the App Is Inactive
Folder Added on Android Is Not Visible via Usb
Floatingactionbutton Doesn't Hide
Using Webview Sethttpauthusernamepassword
Android - How to Intercept the 'Install Application' Intent
Android Sdk Content Loader Failing with Nullpointerexception
How Does One Implement Drag and Drop for Android Marker
Searchview Getactionview Returning Null
Rotate Zoom Drag Image in Android Imageview
Firebase: How to Set Default Notification Channel in Android App
Refresh or Force Redraw the Fragment
Why Is Calling Process.Killprocess(Process.Mypid()) a Bad Idea