5

我在 Eclipse 中成功编译了 ActionBarSherlock。

但是当我在一个新项目中使用它时出现 75 个错误:

abs4.1.0\library\res\values-v14\abs__styles.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionBar'.
abs4.1.0\library\res\values-v14\abs__styles.xml:6: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionBar.Solid'.
abs4.1.0\library\res\values-v14\abs__styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar'.
abs4.1.0\library\res\values-v14\abs__styles.xml:10: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.Solid'.
abs4.1.0\library\res\values-v14\abs__styles.xml:12: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.Solid.Inverse'.
abs4.1.0\library\res\values-v14\abs__styles.xml:15: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionBar.TabView'.
abs4.1.0\library\res\values-v14\abs__styles.xml:17: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.TabView'.
abs4.1.0\library\res\values-v14\abs__styles.xml:19: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.TabView.Inverse'.
abs4.1.0\library\res\values\abs__styles.xml:89: error: Error: No resource found that matches the given name: attr 'android:dividerPadding'.
abs4.1.0\library\res\values\abs__styles.xml:88: error: Error: No resource found that matches the given name: attr 'android:showDividers'.    

MainActivity.java

package com.stackoverflow.users.comfreek.testproject

import android.os.Bundle;
import com.actionbarsherlock.app.SherlockActivity;

public class MainActivity extends SherlockActivity {
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
  }
}

我已经将活动主题设置为@style/Theme.Sherlock.

4

2 回答 2

7

确保您已将 API 级别设置为 13。

请参阅此类似问题的答案https://stackoverflow.com/a/8591853/808940

于 2012-06-23T15:55:09.913 回答
0

将项目的部署目标设置为:

android >= honeycomb

于 2012-06-23T15:54:59.043 回答