更新至ADT 20後,我無法再成功導出任何Android項目。我得到:更新至ADT後導出Android項目時的Proguard錯誤
Proguard returned with error code 1. See console
在控制檯中我得到噸can't find referenced class
警告偶爾can't find superclass or interface
警告。在警告結束時,我得到這樣的:
You should check if you need to specify additional program jars.
Warning: there were 199 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)
每次我試圖建立我得到的警告不同的數字(這不是很一致)。另外,當我在導出之前執行清理時,導出完成時不會產生任何警告,但是由於ClassNotFoundException
導致APK在啓動時崩潰。
我的proguard-project.txt
包含Android支持庫和ActionBarSherlock的必要規則-keep class
。
我有沒有問題,建設這個項目ADT 20之前我甚至嘗試建立我的最後一個版本(這顯然建立了良好的,當我發佈),但我得到相同的ProGuard警告和失敗的導出。
我已經嘗試添加-libraryjars
和/或-dontwarn
規則,就像許多其他的SO問題一樣,但無濟於事。它有時會成功構建,但APK在啓動時創建崩潰。
有什麼建議嗎?
我也嘗試從proguard 4.7(隨r20工具一起)更新到proguard 4.8,但這似乎沒有什麼區別。 – ashughes 2012-07-14 17:35:11
在將r20 Android工具中'proguard-android.txt'中添加的proguard規則添加到我的'proguard-project.txt'後,我終於成功地構建並運行了一個模糊的APK。在發佈答案之前等待確認這是一個錯誤:http://code.google.com/p/android/issues/detail?id=35107 – ashughes 2012-07-17 22:15:56