ActionBarSherlock 4.2.0在尝试构建时返回一堆错误

时间:2012-11-10 23:44:18

标签: android intellij-idea actionbarsherlock android-library

我试图更改Android应用以使用ActionBarSherlock。我添加了库并正确设置了所有内容(我认为)。但是当我尝试运行应用程序时,我遇到了一堆错误,而不是应用程序本身,而是使用ActionBarSherlock源代码。

以下是它的意思:

Information:Compilation completed with 24 errors and 13 warnings
Information:24 errors
Information:13 warnings
C:\Users\Nolan\IdeaProjects\ActionBarSherlock-4.2.0\library\src\com\actionbarsherlock\app\ActionBar.java
    Warning:Warning:line (949)[deprecation] FILL_PARENT in LayoutParams has been deprecated
C:\Users\Nolan\IdeaProjects\ActionBarSherlock-4.2.0\library\src\com\actionbarsherlock\internal\app\ActionBarImpl.java
    Error:Error:line (66)error: ActionBarImpl is not abstract and does not override abstract method setSecondaryProgress(int) in ActionBarSherlock
    Error:Error:line (135)error: constructor ActionBar in class ActionBar cannot be applied to given types;
required: Activity,int
found: no arguments
reason: actual and formal argument lists differ in length
    Error:Error:line (147)error: constructor ActionBar in class ActionBar cannot be applied to given types;
required: Activity,int
found: no arguments
reason: actual and formal argument lists differ in length
C:\Users\Nolan\IdeaProjects\ActionBarSherlock-4.2.0\library\src\com\actionbarsherlock\internal\widget\ActionBarContainer.java
    Warning:Warning:line (58)[deprecation] setBackgroundDrawable(Drawable) in View has been deprecated
C:\Users\Nolan\IdeaProjects\ActionBarSherlock-4.2.0\library\src\com\actionbarsherlock\internal\widget\ActionBarContextView.java
    Warning:Warning:line (81)[deprecation] setBackgroundDrawable(Drawable) in View has been deprecated
    Warning:Warning:line (115)[deprecation] setBackgroundDrawable(Drawable) in View has been deprecated
    Warning:Warning:line (129)[deprecation] setBackgroundDrawable(Drawable) in View has been deprecated
    Warning:Warning:line (231)[deprecation] setBackgroundDrawable(Drawable) in View has been deprecated
    Warning:Warning:line (244)[deprecation] setBackgroundDrawable(Drawable) in View has been deprecated
C:\Users\Nolan\IdeaProjects\ActionBarSherlock-4.2.0\library\src\com\actionbarsherlock\internal\widget\ScrollingTabContainerView.java
    Warning:Warning:line (280)[deprecation] setBackgroundDrawable(Drawable) in View has been deprecated
C:\Users\Nolan\IdeaProjects\ActionBarSherlock-4.2.0\library\src\com\actionbarsherlock\internal\widget\IcsProgressBar.java
    Warning:Warning:line (207)[deprecation] animationResolution in attr has been deprecated
C:\Users\Nolan\IdeaProjects\ActionBarSherlock-4.2.0\library\src\com\actionbarsherlock\internal\view\menu\MenuPopupHelper.java
    Warning:Warning:line (145)[deprecation] removeGlobalOnLayoutListener(OnGlobalLayoutListener) in ViewTreeObserver has been deprecated
    Warning:Warning:line (216)[deprecation] removeGlobalOnLayoutListener(OnGlobalLayoutListener) in ViewTreeObserver has been deprecated
C:\Users\Nolan\IdeaProjects\ActionBarSherlock-4.2.0\library\src\com\actionbarsherlock\internal\app\ActionBarWrapper.java
    Error:Error:line (16)error: ActionBarWrapper is not abstract and does not override abstract method startActionMode(Callback) in ActionBarSherlock
    Error:Error:line (24)error: constructor ActionBar in class ActionBar cannot be applied to given types;
required: Activity,int
found: no arguments
reason: actual and formal argument lists differ in length
C:\Users\Nolan\IdeaProjects\ActionBarSherlock-4.2.0\library\src\com\actionbarsherlock\internal\view\ActionProviderWrapper.java
    Warning:Warning:line (22)[deprecation] onCreateActionView() in ActionProvider has been deprecated
C:\Users\Nolan\IdeaProjects\ActionBarSherlock-4.2.0\library\src\com\actionbarsherlock\internal\view\menu\ListMenuItemView.java
    Warning:Warning:line (86)[deprecation] setBackgroundDrawable(Drawable) in View has been deprecated
C:\Users\Nolan\IdeaProjects\ActionBarSherlock-4.2.0\library\test\com\actionbarsherlock\internal\ManifestParsingTest.java
    Error:Error:line (3)error: package org.junit does not exist
    Error:Error:line (5)error: cannot find symbol class ActionBarSherlockCompat
    Error:Error:line (5)error: static import only from classes and interfaces
    Error:Error:line (6)error: package org.hamcrest does not exist
    Error:Error:line (6)error: static import only from classes and interfaces
    Error:Error:line (7)error: package org.junit does not exist
    Error:Error:line (7)error: static import only from classes and interfaces
    Error:Error:line (10)error: cannot find symbol class Test
    Error:Error:line (17)error: cannot find symbol class Test
    Error:Error:line (24)error: cannot find symbol class Test
    Error:Error:line (31)error: cannot find symbol class Test
    Error:Error:line (13)error: cannot find symbol method cleanActivityName(String,String)
    Error:Error:line (14)error: cannot find symbol method equalTo(String)
    Error:Error:line (20)error: cannot find symbol method cleanActivityName(String,String)
    Error:Error:line (21)error: cannot find symbol method equalTo(String)
    Error:Error:line (27)error: cannot find symbol method cleanActivityName(String,String)
    Error:Error:line (28)error: cannot find symbol method equalTo(String)
    Error:Error:line (34)error: cannot find symbol method cleanActivityName(String,String)
    Error:Error:line (35)error: cannot find symbol method equalTo(String)

我真的不确定出了什么问题,因为它似乎不是我所做的任何事情,而是ActionBarSherlock本身的问题。我该怎么办?

此外,我还使用IntelliJ IDEA创建和构建项目。项目本身是一个有两个不同版本的图书馆项目,所以我可以支持免费和付费版本的应用程序。

1 个答案:

答案 0 :(得分:3)

1)您是否正确地在项目中添加了ActionbBarSherlock? see Librairy

2)你的项目目标是> = Android 3.0吗? see Project Build Target

3)你在项目中使用android支持librairy吗?如果是这样,请删除它,因为它已经在ActionBarSherlock librairy

See Java Build Path

4)每次尝试将ActionBarSherlock包含到项目中时,请确保执行步骤1,2,3并经常清理这些项目,如果您看到任何" x"和"!"这两个项目都有标记 Project -> Clean...