2012-06-23 40 views
19

好吧,我試圖讓ActionBarSherlock工作後,讓我輸入庫由:ActionBarSherlock庫是充滿了錯誤被導入

Creating New Project > Create Project From Existing Source > Choosing library from the ActionBarSherlock folder 

之後,我進口從樣本示例項目文件夾使用同樣的方法,庫和示例都設置爲Android 15構建路徑!

我的問題是,庫中出現了100多個錯誤,關於Call的各種東西需要api level 11,而且我不知道什麼是錯的!

事情我已經嘗試:
清潔工程
設置構建路徑,以13,14和15

大多數錯誤說:

Call requires API level 11 (current min is 8): android.app.something 

更新:我試着右擊上的lib文件和點擊添加構建路徑,這沒有奏效,這些是我得到的一些錯誤:

Description Resource Path Location Type 
The method add(CharSequence) of type MenuWrapper must override a superclass method MenuWrapper.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 33 Java Problem 
The method add(int, int, int, CharSequence) of type MenuWrapper must override a superclass method MenuWrapper.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 43 Java Problem 
The method add(int, int, int, int) of type MenuWrapper must override a superclass method MenuWrapper.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 48 Java Problem 
The method add(int) of type MenuWrapper must override a superclass method MenuWrapper.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 38 Java Problem 
The method addIntentOptions(int, int, int, ComponentName, Intent[], Intent, int, MenuItem[]) of type MenuWrapper must override a superclass method MenuWrapper.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 81 Java Problem 
The method addOnAttachStateChangeListener(View_OnAttachStateChangeListener) of type ActionMenuItemView must override a superclass method ActionMenuItemView.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 84 Java Problem 
The method addOnAttachStateChangeListener(View_OnAttachStateChangeListener) of type ActionMenuPresenter.OverflowMenuButton must override a superclass method ActionMenuPresenter.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 627 Java Problem 
The method addSubMenu(CharSequence) of type MenuWrapper must override a superclass method MenuWrapper.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 61 Java Problem 
The method addSubMenu(int, int, int, CharSequence) of type MenuWrapper must override a superclass method MenuWrapper.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 71 Java Problem 
The method addSubMenu(int, int, int, int) of type MenuWrapper must override a superclass method MenuWrapper.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 76 Java Problem 
The method addSubMenu(int) of type MenuWrapper must override a superclass method MenuWrapper.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 66 Java Problem 
The method clear() of type MenuWrapper must override a superclass method MenuWrapper.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 101 Java Problem 
The method clearHeader() of type SubMenuWrapper must override a superclass method SubMenuWrapper.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 49 Java Problem 
The method close() of type MenuWrapper must override a superclass method MenuWrapper.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 157 Java Problem 
The method collapseActionView() of type ActionMenuItem must override a superclass method ActionMenuItem.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 264 Java Problem 
The method collapseActionView() of type MenuItemImpl must override a superclass method MenuItemImpl.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 612 Java Problem 
The method collapseActionView() of type MenuItemWrapper must override a superclass method MenuItemWrapper.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 254 Java Problem 
The method collapseItemActionView(MenuBuilder, MenuItemImpl) of type ActionBarView.ExpandedActionViewMenuPresenter must override a superclass method ActionBarView.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/widget line 1497 Java Problem 
The method describeContents() of type ActionMenuPresenter.SavedState must override a superclass method ActionMenuPresenter.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 557 Java Problem 
The method expandActionView() of type ActionMenuItem must override a superclass method ActionMenuItem.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 259 Java Problem 
The method expandActionView() of type MenuItemImpl must override a superclass method MenuItemImpl.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 598 Java Problem 
The method expandActionView() of type MenuItemWrapper must override a superclass method MenuItemWrapper.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 249 Java Problem 
The method expandItemActionView(MenuBuilder, MenuItemImpl) of type ActionBarView.ExpandedActionViewMenuPresenter must override a superclass method ActionBarView.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/widget line 1471 Java Problem 
The method findItem(int) of type MenuWrapper must override a superclass method MenuWrapper.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 127 Java Problem 
The method flagActionItems() of type ActionBarView.ExpandedActionViewMenuPresenter must override a superclass method ActionBarView.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/widget line 1466 Java Problem 
The method flagActionItems() of type MenuPopupHelper must override a superclass method MenuPopupHelper.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 280 Java Problem 
The method getActionProvider() of type ActionMenuItem must override a superclass method ActionMenuItem.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 243 Java Problem 
The method getActionProvider() of type MenuItemWrapper must override a superclass method MenuItemWrapper.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 240 Java Problem 
The method getActionView() of type MenuItemWrapper must override a superclass method MenuItemWrapper.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 229 Java Problem 
The method getAlphabeticShortcut() of type MenuItemWrapper must override a superclass method MenuItemWrapper.java /com_actionbarsherlock/src/com/actionbarsherlock/internal/view/menu line 123 Java Problem 
+0

你能至少要命名幾個具體的錯誤? – EboMike

+0

@EboMike我編輯了我的問題。 –

+0

@AlexLockwood對不起,它有大約150個,他們都說了一些不同的東西。我添加了更多的錯誤 –

回答

54
  • 轉到項目屬性> Java編譯器。使用JDK 1.6。
  • 確保您使用Android 4.0+編譯庫和應用程序
  • 確保您的targetSdkVersion爲14或更高。
+2

非常感謝sooo,工作! :D我將它設置爲JDK 1.5。附: ActionBarSherlock完全真棒! –

+1

感謝的人,這也爲我工作! – slinden77

+0

@Jake Wharton是那個了不起的圖書館的創造者......我們都應該感謝他...... – aProgrammer

6
  1. 在項目瀏覽器中,找到libs目錄中的android-support-v4.jar文件。用鼠標右鍵單擊該文件,並將其與添加到您的構建路徑:

    構建路徑 - >添加到構建路徑

0

點擊右鍵,選擇屬性,Java構建路徑,庫選項卡上,單擊添加庫...並添加JRE系統庫1.6

0

點擊右鍵,選擇屬性,Java構建路徑,庫卡口;點擊「Add Libraries」並添加「JRE System Library 1.6」。

確認修改,並刪除稍後添加的JRE系統庫。

0

驗證新的庫清單包是「com.actionbarsherlock」

(也許這只是我,但我創建了在那裏我已經提取的庫文件夾頂部的項目。)