我試圖通過包瀏覽器中的內置Proguard支持使用Proguard導出>導出Android應用程序。主項目使用一個庫項目,該項目反過來使用android兼容庫,它也使用這個兼容庫。基本上,像這樣:與Android項目使用(兼容性)庫的Proguard
BaseLibraryProject BaseActitivity 庫:Android的支持,v4.jar MainProject 使用庫BaseLibraryProject 庫:Android的支持,v4.jar
這個應用程序同時運行的設備和simluators OK 。 然而Proguard的發出大量警告,並編碼1
存在這是Proguard的有關上市的最後一位:
[2012-04-09 14:19:49 - MainProject] Warning: android.support.v4.widget.SearchViewCompatHoneycomb: can't find referenced class android.widget.SearchView
[2012-04-09 14:19:49 - MainProject] Warning: android.support.v4.widget.SearchViewCompatHoneycomb: can't find referenced class android.widget.SearchView
[2012-04-09 14:19:49 - MainProject] Warning: android.support.v4.widget.SearchViewCompatHoneycomb: can't find referenced class android.widget.SearchView$OnQueryTextListener
[2012-04-09 14:19:49 - MainProject] Warning: android.support.v4.widget.SearchViewCompatHoneycomb: can't find referenced class android.widget.SearchView
[2012-04-09 14:19:49 - MainProject] Warning: android.support.v4.widget.SearchViewCompatHoneycomb$1: can't find referenced class android.widget.SearchView$OnQueryTextListener
[2012-04-09 14:19:49 - MainProject] Warning: android.support.v4.widget.SearchViewCompatHoneycomb$1: can't find referenced class android.widget.SearchView
[2012-04-09 14:19:49 - MainProject] Warning: there were 131 unresolved references to classes or interfaces.
[2012-04-09 14:19:49 - MainProject] You may need to specify additional library jars (using '-libraryjars').
[2012-04-09 14:19:49 - MainProject] Warning: there were 29 unresolved references to program class members.
[2012-04-09 14:19:49 - MainProject] Your input classes appear to be inconsistent.
[2012-04-09 14:19:49 - MainProject] You may need to recompile them and try again.
[2012-04-09 14:19:49 - MainProject] Alternatively, you may have to specify the option
[2012-04-09 14:19:49 - MainProject] '-dontskipnonpubliclibraryclassmembers'.
[2012-04-09 14:19:49 - MainProject] java.io.IOException: Please correct the above warnings first.
正如你看到的:它無法找到兼容性庫。
這是既-libraryjars和-dontskipnonpubliclibraryclassmembers的proguard.cfg文件的開始包括:
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-verbose
-libraryjars libs/android-support-v4.jar
不有所作爲。我嘗試了將庫添加到BaseLibrary項目/ MainProject,完全限定路徑名的各種組合。似乎沒有任何幫助。
關於proguard的大多數stackoverflow問題似乎涉及設置Ant。 任何想法可能導致這個問題,以及如何讓Proguard在這個使用多個庫的項目上工作?
由於事先
只需添加行proguard.config = $ {sdk。dir} \ tools \ proguard \ proguard-android.txt:proguard-project.txt並刪除proguard.cfg使其工作 – 2012-04-10 11:40:07