跳到主要內容

Proguard returned with error code 1 (Unexpected end of ZLIB input stream) 的奇怪問題

今天更新了 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

留言

這個網誌中的熱門文章

App 在 Google Play 被停權與恢復的經驗分享

最近心情真像是洗了三溫暖~ 前幾天把已經很久沒維護的  EZ App安裝器  稍微調整了 UI,修了修 Bug,提交更新。 幾個小時過去發現 Google Play 還沒反應,感覺有點怪...可能是系統忙碌吧。當下也沒想太多就跑去睡了。 隔天一早打開開發者控制台,登愣!又看到熟悉的景象... App 被停權了!!! 為什麼說"又"呢? 出來混總是要還的,被停權也不是第一次了。 多年前剛開始在 Google Play 上架時,學別人在商店描述裡加了一堆 Keyword,其實有沒有用也不知道。然後某次開發人員計劃政策調整後,這種行為被視為違規,於是一下子被停權兩隻 App。 畢竟是自己沒注意到政策調整,而且罪證確鑿,只好摸摸鼻子認了。不過明明是很簡單就能修正的問題,Google 總是完全不給機會就直接停權,手段實在狠毒!這也是最讓人難以接受的地方。 順帶一題,Google Play 的違規處分大概分為以下幾種: 拒絕 :更新版本遭拒,但之前所發佈的版本仍會保留在 Google Play 商店中。 下架 :應用程式會從 Google Play 下架。必須提交符合規範的更新版本,才能讓應用程式重新上架。 停權 :應用程式會從 Google Play 下架。必須更改 package name,才能讓應用程式重新上架。這意味著將失去原本累積的下載數、統計資料和評分,一切重頭來過。 終止開發者帳號 :所有應用皆會下架,無法再上架新應用。"相關帳戶"也會一併處分,不允許再註冊新的開發者帳號。 我三次遇到的都是停權,但這次的原因是為什麼呢? 根據信裡的說明是違反了開發人員發佈協議的"其他商店"條款。 什麼是"其他商店"條款? 4.5 其他商店。凡是「產品」具有任何推廣其他商店之用途,藉此引導使用者透過這類替代性管道發佈 Android 軟體應用程式或遊戲,則一概禁止在「商店」中發佈或提供。 奇怪?我的 App 裡面沒有推廣其他應用程式商店啊? 信中有申訴的管道,寫信去問明白吧。網頁說可以用中文 、 英文 、 日文及韓文提出申訴,就直接寫中文吧。一來比較好溝通,同時看看都是講中文的會不會比較寬大為懷 XDD~ 提出申訴後過了幾個小時,收到回覆了...

設定 Google Play Payments 與 AdSense 的電匯付款銀行

有上架 App 到 Google Play 營利的開發者最關心的就是如何收取款項了。 目前付費 App 與 In-app Billing 的收益是透過 Google Play Payments 直接電匯到開發者的銀行帳戶。而 AdMob 廣告收益則是由 AdSense 透過支票,電匯或西聯匯款給開發者。 這篇介紹如何設定電匯付款銀行的部份。 首先登入 Google Play Console 或 AdSense,接著到付款設定新增電匯付款,會看到一些欄位需要填寫: 欄位說明: 帳戶所有人名稱:請填入你的英文譯名,建議跟護照上一樣,方便行員辨識。 千萬不要填 John、David、Mary 這種喔。 銀行名稱:請填入銀行英文名稱,我是在臺銀南港分行開的戶,我就填 BANK OF TAIWAN Nan Kang Branch。 SWIFT-BIC (電匯代碼):請填入銀行的電匯代碼,可以詢問你的開戶銀行或在  這邊  查詢。我是直接去分行問的,通常銀行會準備一張類似下面這種小紙條給你,上面就有所需資訊。 帳號:請填入你的銀行帳號。這裡填台幣或外幣帳戶都可以,填台幣帳戶的話銀行會在收到款項時直接幫你依當天匯率轉存為台幣。我自己是填外幣帳戶,想說可以等匯率比較好的時候再轉換。 填妥後送出驗證就可以每個月等著收錢啦!(前提是要有達到最低付款金額100美元)。另外要注意的是 匯入匯款可能會有手續費產生( 包含本地銀行及 中轉銀行),依銀行不同,金額也有所差異。 以臺銀為例,不管你是匯到台幣或外幣帳戶,每筆會收至少200台幣的手續費。 以我自己的經驗來說,用臺銀收款1200美元,本地加中轉總共被扣了大概14美元。 希望以上資訊能幫到大家,感謝 :-) 參考資料: http://support.google.com/googleplay/android-developer/bin/answer.py?hl=zh-Hant&answer=2700656 http://dada.tw/2014/03/03/677/ http://weisue.pixnet.net/blog/post/30006232 http://www.bot.com.tw/ebc/ebcboard/qnadetail.asp...

EZ Folder Player (Ad) Privacy Policy

Privacy Policy EZWorks built the EZ Folder Player (Ad) app as an Ad Supported app. This SERVICE is provided by EZWorks at no cost and is intended for use as is. This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service. If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy. The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which are accessible at EZ Folder Player (Ad) unless otherwise defined in this Privacy Policy. Information Collection and Use For a better experience, while using our Service, I may require you to provide us with certain personally identifiable information. The informatio...