2012-06-23 22 views
19

Được rồi, tôi đang cố gắng để có được ActionBarSherlock làm việc, vì vậy tôi nhập thư viện theo:thư viện ActionBarSherlock là đầy đủ các lỗi sau khi được nhập khẩu

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

Sau đó tôi nhập khẩu một dự án ví dụ từ các mẫu folder bằng cách sử dụng cùng một phương thức, Cả thư viện và mẫu được đặt thành Đường dẫn xây dựng Android 15!

Vấn đề của tôi là, hơn 100 lỗi xuất hiện trong thư viện, tất cả các loại nội dung về Cuộc gọi yêu cầu cấp api 11, Và tôi không biết có gì sai!

Những điều tôi đã cố gắng:
sạch Dự án
Setting xây dựng đường dẫn đến 13, 14 và 15

Hầu hết các lỗi nói:

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

Cập nhật: Tôi đã cố gắng đúng cách nhấp vào lib và nhấp vào thêm để tạo đường dẫn, không hoạt động, đây là một vài lỗi mà tôi nhận được:

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

Can bạn tên ít nhất một vài lỗi cụ thể? – EboMike

+0

@EboMike Tôi đã chỉnh sửa câu hỏi của mình. –

+0

@AlexLockwood xin lỗi, nó có khoảng 150 người trong số họ và tất cả họ đều nói điều gì đó khác biệt. Tôi đã thêm nhiều lỗi hơn –

Trả lời

54
  • Đến Project Properties> Java Compiler. Sử dụng JDK 1.6.
  • Đảm bảo bạn đang biên soạn cả thư viện và ứng dụng của mình với Android 4.0+
  • Đảm bảo targetSdkVersion của bạn là 14 hoặc cao hơn.
+2

Cảm ơn rất nhiều, đã hoạt động! : D Tôi đã thiết lập nó trên JDK 1.5. p.s. ActionBarSherlock hoàn toàn tuyệt vời! –

+1

cảm ơn người đàn ông, điều đó cũng làm việc cho tôi! – slinden77

+0

@Jake Wharton là tác giả của thư viện tuyệt vời đó ... Tất cả chúng ta nên biết ơn anh ấy ... – aProgrammer

6
  1. Trong trình khám phá dự án, tìm tệp android-support-v4.jar trong thư mục libs. Nhấp chuột phải tập tin này và thêm nó vào xây dựng con đường của bạn với:

    con đường xây dựng ->Thêm để xây dựng con đường

0

click chuột phải, chọn Properties, java xây dựng con đường, thư viện tab, bấm vào Thêm thư viện ... và Add Library Hệ thống JRE 1.6

0

Nhấp chuột phải, chọn Properties, Java Build Path, Libraries tab; nhấp vào "Thêm Thư viện" và thêm "Thư viện Hệ thống JRE 1.6".

Xác nhận sửa đổi và xóa Thư viện hệ thống JRE mà bạn đã thêm sau.

0

Xác minh rằng các thư viện mới gói manifest là "com.actionbarsherlock"

(Có lẽ Nó chỉ là tôi, nhưng tôi đã tạo ra dự án trên đầu trang của nơi mà tôi đã trích ra các thư mục thư viện.)

Các vấn đề liên quan