2012/01/09

在eclipse中升級ADT16.0後lint顯示proguard.cfg錯誤問題

因為前次打包apk不成功

所以檢查了一下看有沒有新的更新

沒想到ADT就升到了16還多出了一個lint

然後就說我的proguard.cfg檔有問題
Looks for problems in proguard.cfg files

Using -keepclasseswithmembernames in a proguard.cfg file is not correct; it can cause some symbols to be renamed which should not be.
Earlier versions of ADT used to create proguard.cfg files with the wrong format. Instead of -keepclasseswithmembernames use -keepclasseswithmembers, since the old flags also implies "allow shrinking" which means symbols only referred to from XML and not Java (such as possibly CustomViews) can get deleted.

 

這段意思是說前版本的ADT自動產生的proguard.cfg的-keepclasseswithmembernames參數是錯誤的,應該更改為-keepclasseswithmembers

不過...

我照修改後存檔一舊還是會跳出這段error

不論我怎麼clean、rebuild、restart eclipse都還是無法解決

最後有找到了一個方法

步驟如下:

 

1.移除你的專案,但千萬不要從磁碟中刪除
   在你的專案上按右鍵,選delete
   Delete project contents on disk的核選方塊千萬不要打勾,按下OK完成刪除
2.重新import你的專案
   選File->Import,在General中選Existing Projects into Workspace
   找到你的workspace資料夾選擇你原本的專案,按Finish完成
 

這樣原本的紅色error就不會再顯示了!

沒有留言:

張貼留言