2

I keep getting this error when switching from a previous project to this project and then trying to export it:

Proguard returned with error code 1. See console
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [modonelib.jar:META-INF/MANIFEST.MF])
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [mymainlib.jar:META-INF/MANIFEST.MF])
java.io.IOException: Can't write [C:\Users\ih8ie8\AppData\Local\Temp\android_8070931993503351509.jar] (Can't read [C:\workspace\MyMainLib\bin\mymainlib.jar] (Unexpected end of ZLIB input stream))
    at proguard.OutputWriter.writeOutput(OutputWriter.java:264)
    at proguard.OutputWriter.execute(OutputWriter.java:160)
    at proguard.ProGuard.writeOutput(ProGuard.java:372)
    at proguard.ProGuard.execute(ProGuard.java:153)
    at proguard.ProGuard.main(ProGuard.java:492)
Caused by: java.io.IOException: Can't read [C:\workspace\MyMainLib\bin\mymainlib.jar] (Unexpected end of ZLIB input stream)
    at proguard.InputReader.readInput(InputReader.java:230)
    at proguard.InputReader.readInput(InputReader.java:200)
    at proguard.OutputWriter.writeOutput(OutputWriter.java:253)
    ... 4 more
Caused by: java.io.EOFException: Unexpected end of ZLIB input stream
    at java.util.zip.InflaterInputStream.fill(Unknown Source)
    at java.util.zip.InflaterInputStream.read(Unknown Source)
    at java.util.zip.ZipInputStream.read(Unknown Source)
    at java.util.zip.ZipInputStream.closeEntry(Unknown Source)
    at java.util.zip.ZipInputStream.getNextEntry(Unknown Source)
    at proguard.io.JarReader.read(JarReader.java:58)
    at proguard.io.DirectoryPump.readFiles(DirectoryPump.java:65)
    at proguard.io.DirectoryPump.pumpDataEntries(DirectoryPump.java:53)
    at proguard.InputReader.readInput(InputReader.java:226)
    ... 6 more

If I exit and restart Eclipse twice, then repeat the same exact procedure, the problem goes away.

While I am able to eventually build a deploy-able app, I prefer getting rid of this error once and for all (it doesn't happen with other apps that I have in my workspace).

Any idea how to troubleshoot this?

Where do I look to find this "duplicate zip entry"?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
ih8ie8
  • 944
  • 8
  • 23
  • 1
    Maybe this could help you out: http://stackoverflow.com/questions/16357959/how-to-solve-cant-write-resource-meta-inf-manifest-mf-duplicate-zip-entry /Phew – Phew Jun 03 '13 at 00:09
  • @Phew Wow that's a great resource, thank you! I don't have `-injars` in my progrard.cfg but there are quite a few links there that are worth exploring. – ih8ie8 Jun 03 '13 at 00:14
  • @Phew Unfortunately none of the resources applied to my situation. Best help so far was from Eric Lafortune (developer of ProGuard, see below). – ih8ie8 Jun 11 '13 at 01:18
  • 1
    I once had this problem and, odd as it may sound, I got rid of it by invoking `Properties` for the project > `Run/Debug Settings` > select (the only) `Launch configuration` for the project > `Edit...` (button) > rename the launch configuration's `Name:` to match exactly the Project's name. Doesn't make any sense but many things on Eclipse don't make sense, and it worked for me. Good luck. – scatmoi Jun 27 '13 at 02:43

1 Answers1

2

The Eclipse build process creates an intermediary jar C:\workspace\MyMainLib\bin\mymainlib.jar, which ProGuard subsequently reads as input jar. At that point, it spuriously seems to be truncated. Maybe there are problems with the file system? You can check if the intermediary jar isn't corrupt, after the build. If it is ok, the problem might be that the file hasn't been flushed to disk when ProGuard reads it. The only workaround I see is to use Ant to perform the release build.

Eric Lafortune
  • 45,150
  • 8
  • 114
  • 106
  • You are the master. Thank you very much. I can't say that the problem has been solved but I can clarify that if the problem were with the file system, I would have seen other apps projects exhibiting similar behavior, because they reside on the same exact workspace. They don't exhibit this problem, so I suspect something specific to this app project which I haven't been able to determine yet. Some hidden configuration setting somewhere. +1 for now. – ih8ie8 Jun 11 '13 at 01:21