10

I used to have Proguard 4.6 working perfectly to export signed applications on Eclipse 3.6.2.

But once I updated my ADT + SDK from 16.0.0.v201112150204-238534 to 18.0.0.v201203301601-306762 I can no longer export signed applications (debug version works fine). Instead I receive the following error log in the console:

Proguard returned with error code 1. See console
java.io.IOException: Can't read [\\bta\wspc\LibProj1\bin\libproj1.jar] (Can't process class [com/bta/blib/proj1/BtClsProj1.class] (Unexpected end of ZLIB input stream))
    at proguard.InputReader.readInput(InputReader.java:230)
    at proguard.InputReader.readInput(InputReader.java:200)
    at proguard.InputReader.readInput(InputReader.java:178)
    at proguard.InputReader.execute(InputReader.java:78)
    at proguard.ProGuard.readInput(ProGuard.java:196)
    at proguard.ProGuard.execute(ProGuard.java:78)
    at proguard.ProGuard.main(ProGuard.java:492)
Caused by: java.io.IOException: Can't process class [com/bta/blib/proj1/BtClsProj1.class] (Unexpected end of ZLIB input stream)
    at proguard.io.ClassReader.read(ClassReader.java:112)
    at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87)
    at proguard.io.JarReader.read(JarReader.java:65)
    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
Caused by: java.lang.RuntimeException: Unexpected end of ZLIB input stream
    at proguard.classfile.io.RuntimeDataInput.readInt(RuntimeDataInput.java:136)
    at proguard.classfile.io.ProgramClassReader.visitProgramClass(ProgramClassReader.java:77)
    at proguard.classfile.ProgramClass.accept(ProgramClass.java:346)
    at proguard.io.ClassReader.read(ClassReader.java:91)
    ... 11 more

I searched SO for clues but the only related thread I've been able to find is about Proguard 4.7 with Eclipse SDK 3.7.1 with some reference to "Samsung's SPen SDK 1.5" which I clearly don't have.

Any idea what could be causing this and how to fix the problem?

Community
  • 1
  • 1
Regex Rookie
  • 10,432
  • 15
  • 54
  • 88

5 Answers5

20

I solved it by switching from OpenJDK 7 back to Sun JDK 6.

Update:

The problem came back using JDK 6. My current solution: turn off Project -> Build Automatically when exporting.

Szabolcs Berecz
  • 4,081
  • 1
  • 22
  • 21
11

Problem solved by updating Proguard to the latest 4.8.

UPDATE: While updating to Proguard 4.8 solved the problem, it re-occurred in another project that is almost identical to the one that first exhibited the problem (it uses same library project). Knowing that the entire environment is identical I didn't know why this was happening (and why Proguard is so inconsistent). After about two hours of chasing my tail, I finally had a guess: The proguard.cfg file was not edited via Eclipse, but rather via WinMerge. As soon as I copied over the (identical!) proguard.cfg from the working project, the problem disappeared.

Apparently, Proguard has a problem with CRLF vs. LF.

Regex Rookie
  • 10,432
  • 15
  • 54
  • 88
2

The error message suggests that an input jar that is passed to ProGuard is corrupt. You can easily check this after the failed build. Maybe your disk partition is full.

Eric Lafortune
  • 45,150
  • 8
  • 114
  • 106
  • I already posted yesterday my findings (along with the correct solution for my particular case). My disk partition is far from being full. Any idea why Proguard couldn't use a proguard.cfg that has been patched via WinMerge? +1 for now. – Regex Rookie Jun 12 '12 at 20:35
  • 2
    As far as I can tell, ProGuard handles CR/LF fine. The root cause "Unexpected end of ZLIB input stream" for libproj1.jar (coming from a java runtime class) strongly suggests that the jar is corrupt. This is easy to check. ProGuard versions or merged configurations seem incidental. – Eric Lafortune Jun 12 '12 at 21:55
0

This can occur because a file has been changed since the last time you tested the project so the project may not be built fully. Clean and run the project on a device and then try exporting.

RobCroll
  • 2,571
  • 1
  • 26
  • 36
0

problem solved by commenting the line in project.propterties i.e

proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
benka
  • 4,732
  • 35
  • 47
  • 58
Mac
  • 19
  • 4