今天更新了 ADT 22.0.0 後,除了發生 NoClassDefFoundError 的錯誤之外,還遇到另一個奇怪的問題。
某個專案在 Export Signed APK 時,Proguard 會出現下面這個錯誤:
Proguard returned with error code 1. See console
java.io.IOException: Can't read [E:\android-work2\ActionBarSherlock-4.2.0\library\bin\actionbarsherlock-4.2.0.jar] (Can't process class [com/actionbarsherlock/widget/SearchView$3.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/actionbarsherlock/widget/SearchView$3.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.readFully(RuntimeDataInput.java:112)
at proguard.classfile.io.ProgramClassReader.visitUtf8Constant(ProgramClassReader.java:249)
at proguard.classfile.constant.Utf8Constant.accept(Utf8Constant.java:148)
at proguard.classfile.io.ProgramClassReader.visitProgramClass(ProgramClassReader.java:97)
at proguard.classfile.ProgramClass.accept(ProgramClass.java:346)
at proguard.io.ClassReader.read(ClassReader.java:91)
... 11 more
看起來似乎是我使用的某個第三方函式庫出問題,但奇怪的是其他使用相同函式庫的專案確沒有問題。檢查了專案設定也看不出有什麼異常。更怪的是還不是每次都會發生,偶爾會僥倖讓我輸出成功...(囧)
最後查到也有人遇到這樣的問題,中間他試了好幾種方法都不能完全解決,目前他使用的方法是在 Export Signed APK 前先將 Eclipse 的 Project -> Build Automatically 關閉。
我按照他的方法,雖然有點麻煩但確實能避開這個問題,在此分享給各位~
參考連結:
http://android.deveronline.com/2012/02/proguard-returned-with-error-code-1-after-update-from-adt-1.html
某個專案在 Export Signed APK 時,Proguard 會出現下面這個錯誤:
Proguard returned with error code 1. See console
java.io.IOException: Can't read [E:\android-work2\ActionBarSherlock-4.2.0\library\bin\actionbarsherlock-4.2.0.jar] (Can't process class [com/actionbarsherlock/widget/SearchView$3.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/actionbarsherlock/widget/SearchView$3.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.readFully(RuntimeDataInput.java:112)
at proguard.classfile.io.ProgramClassReader.visitUtf8Constant(ProgramClassReader.java:249)
at proguard.classfile.constant.Utf8Constant.accept(Utf8Constant.java:148)
at proguard.classfile.io.ProgramClassReader.visitProgramClass(ProgramClassReader.java:97)
at proguard.classfile.ProgramClass.accept(ProgramClass.java:346)
at proguard.io.ClassReader.read(ClassReader.java:91)
... 11 more
看起來似乎是我使用的某個第三方函式庫出問題,但奇怪的是其他使用相同函式庫的專案確沒有問題。檢查了專案設定也看不出有什麼異常。更怪的是還不是每次都會發生,偶爾會僥倖讓我輸出成功...(囧)
最後查到也有人遇到這樣的問題,中間他試了好幾種方法都不能完全解決,目前他使用的方法是在 Export Signed APK 前先將 Eclipse 的 Project -> Build Automatically 關閉。
我按照他的方法,雖然有點麻煩但確實能避開這個問題,在此分享給各位~
參考連結:
http://android.deveronline.com/2012/02/proguard-returned-with-error-code-1-after-update-from-adt-1.html
留言
張貼留言