27

可能重复:
ActionBarSherlock 4.0 不起作用。但是 3.5.1 可以。

我正在尝试将 ActionBarSherlock 用于我的应用程序,但是在从另一个库项目中引用 ActionBarSherlock 时似乎存在问题。

这是因为我使用一个 UI 项目来创建所有活动,但这个项目实际上是一个库。所以我需要这个UI项目中的ActionBarSherlock组件,但是当我提到ActionBarSherlock时出现以下错误:

...\ActionBarSherlockLibrary\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'.
...\ActionBarSherlockLibrary\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'.
...\ActionBarSherlockLibrary\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'.
...\ActionBarSherlockLibrary\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'.
...\ActionBarSherlockLibrary\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'.
...\ActionBarSherlockLibrary\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'.
...\ActionBarSherlockLibrary\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'.
...\ActionBarSherlockLibrary\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'.
...\ActionBarSherlockLibrary\res\values\abs__styles.xml:89: error: Error: No resource found that matches the given name: attr 'android:dividerPadding'.
...\ActionBarSherlockLibrary\res\values\abs__styles.xml:88: error: Error: No resource found that matches the given name: attr 'android:showDividers'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:22: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionBar.TabBar'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:24: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.TabBar'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:26: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.TabBar.Inverse'.
...\ActionBarSherlockLibrary\res\values\abs__styles.xml:101: error: Error: No resource found that matches the given name: attr 'android:textAllCaps'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:29: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionBar.TabText'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:31: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.TabText'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:33: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionBar.TabText.Inverse'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:36: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionButton'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:38: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionButton'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:41: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionButton.CloseMode'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:43: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionButton.CloseMode'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:46: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionButton.Overflow'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:48: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionButton.Overflow'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:51: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ActionMode'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:53: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionMode'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:55: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ActionMode.Inverse'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:58: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.PopupMenu'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:60: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.PopupMenu'.
...\ActionBarSherlockLibrary\res\values\abs__styles.xml:184: error: Error: No resource found that matches the given name: attr 'android:dividerPadding'.
...\ActionBarSherlockLibrary\res\values\abs__styles.xml:183: error: Error: No resource found that matches the given name: attr 'android:showDividers'.
...\ActionBarSherlockLibrary\res\values\abs__styles.xml:213: error: Error: No resource found that matches the given name: attr 'android:spinnerMode'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:63: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Spinner'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:65: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.Spinner'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:68: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ListView.DropDown'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:70: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ListView.DropDown'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:73: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.PopupWindow'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:75: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.PopupWindow'.
...\ActionBarSherlockLibrary\res\values\abs__styles.xml:257: error: Error: No resource found that matches the given name: attr 'android:animationResolution'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:78: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ProgressBar'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:80: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ProgressBar'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:83: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.ProgressBar.Horizontal'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:85: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.Light.ProgressBar.Horizontal'.
...\ActionBarSherlockLibrary\res\values\abs__styles.xml:305: error: Error: No resource found that matches the given name: attr 'android:textAllCaps'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:88: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Menu'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:91: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Title'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:93: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Title.Inverse'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:95: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Subtitle'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:97: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionBar.Subtitle.Inverse'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:99: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionMode.Title'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:101: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionMode.Title.Inverse'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:103: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionMode.Subtitle'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:105: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.ActionMode.Subtitle.Inverse'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:108: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.PopupMenu'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:110: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.PopupMenu.Large'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:112: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.PopupMenu.Large'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:114: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.PopupMenu.Small'.
...\ActionBarSherlockLibrary\res\values-v14\abs__styles.xml:116: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Holo.Widget.PopupMenu.Small'.
...\ActionBarSherlockLibrary\res\values-v11\abs__themes.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo'.
...\ActionBarSherlockLibrary\res\values-v11\abs__themes.xml:6: error: Error: No resource found that matches the given name: attr 'android:windowActionBar'.
...\ActionBarSherlockLibrary\res\values-v14\abs__themes.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo'.
...\ActionBarSherlockLibrary\res\values-v11\abs__themes.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light'.
...\ActionBarSherlockLibrary\res\values-v11\abs__themes.xml:10: error: Error: No resource found that matches the given name: attr 'android:windowActionBar'.
...\ActionBarSherlockLibrary\res\values-v14\abs__themes.xml:6: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light'.
...\ActionBarSherlockLibrary\res\values-v14\abs__themes.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light.DarkActionBar'.
...\ActionBarSherlockLibrary\res\values-v14\abs__themes.xml:14: error: Error: No resource found that matches the given name: attr 'android:actionBarWidgetTheme'.
...\ActionBarSherlockLibrary\res\values-v14\abs__themes.xml:20: error: Error: No resource found that matches the given name: attr 'android:windowActionBar'.
...\ActionBarSherlockLibrary\res\values-v14\abs__themes.xml:24: error: Error: No resource found that matches the given name: attr 'android:windowActionBar'.
...\ActionBarSherlockLibrary\res\values\abs__themes.xml:183: error: Error: No resource found that matches the given name: attr 'android:windowActionBar'.
...\ActionBarSherlockLibrary\res\values\abs__themes.xml:184: error: Error: No resource found that matches the given name: attr 'android:windowActionModeOverlay'.
...\ActionBarSherlockLibrary\res\values\abs__themes.xml:185: error: Error: No resource found that matches the given name: attr 'android:windowCloseOnTouchOutside'.
...\ActionBarSherlockLibrary\res\values-v14\abs__themes.xml:28: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Dialog'.
...\ActionBarSherlockLibrary\res\values\abs__themes.xml:209: error: Error: No resource found that matches the given name: attr 'android:windowActionBar'.
...\ActionBarSherlockLibrary\res\values\abs__themes.xml:210: error: Error: No resource found that matches the given name: attr 'android:windowActionModeOverlay'.
...\ActionBarSherlockLibrary\res\values\abs__themes.xml:211: error: Error: No resource found that matches the given name: attr 'android:windowCloseOnTouchOutside'.
...\ActionBarSherlockLibrary\res\values-v14\abs__themes.xml:30: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light.Dialog'.

所以它似乎找不到 Holo 主题,即使所有项目都有android:targetSdkVersion="15"。是否有解决此问题的方法,或者只是无法从库中引用 ActionBarSherlock?

4

2 回答 2

101

我通过将 ActionBarSherlock我的项目的项目构建目标更改为 Android 4.0.3 ( API 15 ) 来解决。

您可以使用Project Properties并单击Android 部分来执行此操作。

请记住在更改 API 级别后进行项目清理。

于 2012-05-03T08:55:00.840 回答
1

您需要将 ABS 添加到您的库项目以及您的其他项目中。

于 2012-05-03T08:50:33.523 回答