3

I am using ActionBarSherlock to implement action bar on my Android 2.1 API 7 project. (With Eclipse IDE)

In order to use sherlock, I imported sherlock library as a existing project on Eclipse. Then, I added it as library on my own project.

However, in my own project, the Eclipse's console shows me the following error:

JakeWharton-ActionBarSherlock-436230d/library/res/values-v11/abs__styles.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo'.

JakeWharton-ActionBarSherlock-436230d/library/res/values-v11/abs__styles.xml:48: error: Error: No resource found that matches the given name: attr 'android:actionBarSize'.

JakeWharton-ActionBarSherlock-436230d/library/res/values-v11/abs__styles.xml:49: error: Error: No resource found that matches the given name: attr 'android:actionBarStyle'.

...

Why??

(I have set target SDK to Android 3.2 for Sherlock.)

Kuffs
  • 35,581
  • 10
  • 79
  • 92
Leem.fin
  • 40,781
  • 83
  • 202
  • 354

4 Answers4

2

Set target SDK to Android 3.2(Version 14) or above. Your desired version can be anything from Android 1.5 (version 7?) upward if I remember correctly.

RobGThai
  • 5,937
  • 8
  • 41
  • 59
  • I have set target SDK to Android 3.2 for Sherlock. – Leem.fin Feb 07 '12 at 08:02
  • 1
    You need to do the same thing on your project as well. – RobGThai Feb 07 '12 at 10:42
  • Why I need to do the same thing on my own project?? Isn't sherlock supposed to use to support native action bar on old android API (e.g. android v2.1 API7) ? And your answer also agreed with me, why your comment conflict with your answer?? – Leem.fin Feb 07 '12 at 15:16
  • I'm not entirely sure. From what I understand, ABS try to support all platforms since 1.5 and upward. Since they are supporting Honeycomb as well, you need to set the target SDK to Honeycomb to get rid of the compile error. I'm not suite sure what you means by me contradicting myself tho. When I say "your desired version" I actually mean the minimum SDK. – RobGThai Feb 07 '12 at 19:01
  • 1
    Also you need to be sure you are compiling with Java 1.6. See here: [ActionBarSherlock library is full of errors after being imported](http://stackoverflow.com/questions/11165700/actionbarsherlock-library-is-full-of-errors-after-being-imported). – mbadawi23 Dec 04 '12 at 15:41
1

Afaik you have to use the api level 14 (or at least honeycomb) library when using ActionBarSherlock. You can still set the minimum version to 7, but the target version has to be ICS (or maybe honeycomb). But then you have to make sure that you're not using any methods introduced in later versions.

Maria Neumayer
  • 3,337
  • 3
  • 27
  • 44
0

Open the ABS Properties and the change the Project Build Target in the Android tab to 13.

adneal
  • 30,484
  • 10
  • 122
  • 151
0

Set in Android-manifest file to target sdk to 14

Tejaswini
  • 357
  • 4
  • 15