2013-07-09 130 views
-3

我正在從Eclipse導入項目。導入後,我收到類似的許多錯誤:如何將一個庫項目SherlockBar添加到Android Studio?

- java: ...\ActionBarSherlock\actionbarsherlock-fest\src\main\java\org\fest\assertions\api\com\actionbarsherlock\view\ActionModeAssert.java:17: cannot find symbol 
symbol : method isNotNull() 
location: class org.fest.assertions.api.com.actionbarsherlock.view.ActionModeAssert 
- java: ...\ActionBarSherlock\actionbarsherlock-fest\src\main\java\org\fest\assertions\api\com\actionbarsherlock\view\ActionModeAssert.java:11: cannot find symbol 
symbol: class AbstractAssert 
- java: ...\ActionBarSherlock\actionbarsherlock-fest\src\main\java\org\fest\assertions\api\com\actionbarsherlock\view\ActionModeAssert.java:17: cannot find symbol 
symbol : method isNotNull() 
location: class org.fest.assertions.api.com.actionbarsherlock.view.ActionModeAssert 
- java: ...\ActionBarSherlock\actionbarsherlock-fest\src\main\java\org\fest\assertions\api\com\actionbarsherlock\view\ActionModeAssert.java:18: cannot find symbol 
symbol : variable actual 
location: class org.fest.assertions.api.com.actionbarsherlock.view.ActionModeAssert 
java: ...\ActionBarSherlock\actionbarsherlock-fest\src\main\java\org\fest\assertions\api\com\actionbarsherlock\view\ActionModeAssert.java:25: cannot find symbol 
symbol : method isNotNull() 
location: class org.fest.assertions.api.com.actionbarsherlock.view.ActionModeAssert 
- java: ...\ActionBarSherlock\actionbarsherlock-fest\src\main\java\org\fest\assertions\api\com\actionbarsherlock\view\ActionModeAssert.java:26: cannot find symbol 
symbol : variable actual 
location: class org.fest.assertions.api.com.actionbarsherlock.view.ActionModeAssert 
- java: ...\ActionBarSherlock\actionbarsherlock-fest\src\main\java\org\fest\assertions\api\com\actionbarsherlock\view\ActionModeAssert.java:27: cannot find symbol 
symbol : method assertThat(android.view.View) 
location: class org.fest.assertions.api.com.actionbarsherlock.view.ActionModeAssert 
+0

這些是ActionBarSherlock的單元測試。每次導入並構建一個模塊,並最後構建單元測試。在Android Studio中,每個相關的項目都被稱爲模塊,這就是我稱之爲模塊的原因。 –

+0

請按照下列步驟操作http://rajeshvijayakumar.blogspot.in/2013/01/how-to-add-actionbarsherlock-library-to.html – Aravin

回答

0

兩個選項:

  1. 你得到的.jar和你添加到你的項目的Libs文件夾。
  2. 您將Sherlock作爲Android Porject添加到Android Studio中,並且在您項目properties中,您將其添加爲庫。
相關問題