web-dev-qa-db-fra.com

Reportez-vous à ActionBarSherlock à partir d'une bibliothèque

Duplicata possible:
ActionBarSherlock 4.0 ne fonctionne pas. Mais 3.5.1 fonctionne.

J'essaie d'utiliser ActionBarSherlock pour mon application, mais il semble y avoir un problème lors de la référence à ActionBarSherlock à partir d'un autre projet de bibliothèque.

C'est parce que j'utilise un projet d'interface utilisateur où je crée toutes les activités, mais ce projet est en fait une bibliothèque. J'ai donc besoin des composants ActionBarSherlock dans ce projet d'interface utilisateur, mais lorsque je me réfère à ActionBarSherlock, les erreurs suivantes apparaissent:

...\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'.

Il semble donc qu'il ne trouve pas les thèmes Holo, même si tous les projets ont Android:targetSdkVersion="15". Existe-t-il un correctif ou n'est-il tout simplement pas possible de se référer à ActionBarSherlock depuis une bibliothèque?

27
Glenn85

J'ai résolu en modifiant Project Build Target of both the ActionBarSherlock library and my projects to Android 4.0.3 (API 15).

Vous pouvez le faire en utilisant Propriétés du projet et en cliquant sur section Android.

N'oubliez pas de faire un Project Clean après avoir changé le niveau API.

101

Vous devez ajouter ABS à votre projet de bibliothèque ainsi qu'à votre autre projet.

1
David Scott