其實這是好久以前的問題了,但 AdMob SDK 改版多次也沒有改善,所以還是記錄一下以供備忘。 當你的 App 使用 AdMob SDK 6.2.0 或之後的版本,在 Expore Signed APK 時 ProGuard 可能會出現以下的錯誤(內容可能依 AdMob SDK 版本而異): Proguard returned with error code 1. See console Warning: com.google.ads.m: can't find referenced class com.google.ads.internal.state.AdState Warning: com.google.ads.m: can't find referenced class com.google.ads.internal.state.AdState You should check if you need to specify additional program jars. Warning: there were 2 unresolved references to classes or interfaces. You may need to specify additional library jars (using '-libraryjars'). java.io.IOException: Please correct the above warnings first. at proguard.Initializer.execute(Initializer.java:321) at proguard.ProGuard.initialize(ProGuard.java:211) at proguard.ProGuard.execute(ProGuard.java:86) at proguard.ProGuard.main(ProGuard.java:492) 一開始試著在 proguard-project.txt 裡加上 -keep class com.google.ads.** {*;},但沒有效果。之後上 Google Groups 詢問才有位 Googler 回說可以忽略這些 Warning,因此只要在
今天更新了 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.FilteredDataE