14

I have a project target to API Level 10 and i want to implement the new ActionBar support library. After follow all the instrutions in the Support Library Setup, when adding the library to my project I came across with dozens of error messages like this:

android-support-v7-appcompat\res\values-v14\styles_base.xml:24: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Holo.....

OK, i know that they are many answers to this question, but, after trying all the more obvious, i still could not solve the error.
I kept searching and found the cause, which is not so obvious, at least for newbies like me.
My intent is provide a full answer to help all those who are like me and do not master all the secrets of the Android development.

1
  • I get errors like this unless both my project & support library target the latest version of Android. I'd rather target a lower version like you are doing
    – Chicowitz
    Commented Nov 5, 2014 at 4:52

3 Answers 3

20

This is what you have to do for use the ActionBar support library correctly.

Follow the instructions in the Support Library Setup - Adding libraries with resources.
One thing that can bring some doubt is add the library to your aplicattion project:

(1) In the Project Explorer, right-click your project and select Properties.
(2) At the left pane select Android.
(3) At th bottom of the right pane click Add
(4) Select the library project android-support-v7-appcompat and click OK. Click OK to close the properties window.

If you not get any of the errors I mentioned it´s all done.

However if you are like me, you dont´t followed the advice of Android team that suggests you always compile your source using the latest SDK, you get the error.

The error ocurrs because my Project Build Target was Android 2.3.3 and need to be at lest 3.0.
It was not immediately clear to me because of the fact that I'm specifically developing for Android 2.3.3 and I'm using support libraries.

OK, I hope this helps.

3
  • Care to explain how to do it without eclipse?
    – weberc2
    Commented Apr 6, 2014 at 19:14
  • Nevermind, I figured it out: stackoverflow.com/questions/22899318/…
    – weberc2
    Commented Apr 7, 2014 at 0:26
  • In Intellij IDEA, you need to go into Project Structure and set your project SDK version for Facebook.
    – gak
    Commented Jun 24, 2014 at 22:53
4

You should add that support library to your project. To add:

Right click on project, then go to :

properties > Java Build Path > Libraries

here Add External JARs...

add android-support-v7-appcompat.jar (path/to/sdk/extras\android\support\v7\appcompat\libs)

Additionally you also have to copy that jar to libs folder of your project, if it is not there automatically.

and you should use the @style/Theme.AppCompat theme for your application for support-v7 to be working

3
  • 1
    That don't work if Project Build Target are below Android 3.0. The solution is Project Build Target to Android 3.0 or higher and there is no need to add the library to Java build path
    – ramaral
    Commented Aug 25, 2013 at 14:52
  • @ramaral, I think support-v7 library supports API 7 and higher. You can refer to Support Library Commented Aug 25, 2013 at 14:58
  • 1
    16, Yes I read this and is because this that i took me so long to find that I could only eliminate the error when target my application to Android 3.0
    – ramaral
    Commented Aug 25, 2013 at 15:12
0

also keep one thing in mind you should change min sdk version to 11 if you want to support("android:windowActionBar")property in your project.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.