3

I just started android programming and i am stuck in this problem from many days , whenever i start a new project every time i get these 5 errors , i don't know what to do with them , i tried setting up whole SDK and eclipse setup but still i get these errors , Any one know about how to get rid of theses ???

  1. R cannot be resolved to a variable
  2. Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light.DarkActionBar',styles.xml/example/res/values-v14line 3 Android AAPT Problem
  3. Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Light'.styles.xml/example/res/values line 3 Android AAPT Problem
  4. Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light'.styles.xml/example/res/values-v11 line 3 Android AAPT Problem
3

4 Answers 4

5

For those stumbling upon this question, here's a solution: In your project.properties, change target=android-x where x < 11 to some x >= 11 e.g target=android-14, because holo was introduced first in android-11 (Honeycomb).

EDIT:

Correction, x>=14 for android:Theme.Holo.Light.DarkActionBar to work.

Sign up to request clarification or add additional context in comments.

Comments

1

For error number 2,3 and 4. In your styles.xml file remove the parent="android:Theme", i used in following way

styles.xml

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <style name="CustomWindowTitleBackground">

    </style>


    <style name="MyTheme" parent="android:Theme">
        <item name="android:windowTitleSize">65dip</item>
        <item name="android:windowTitleBackgroundStyle">@style/CustomWindowTitleBackground</item>
    </style>
</resources>

May i hope this will be solve your First Error. Incase your first error wont clear means, just clean the your application and then run it.

6 Comments

If this works, you should no longer have your first error. Until your resources 'compile' correctly, you will probably get an error with 'R' not being available (as this is what the 'compilation' of your resources produces for your project).
@Sam: ya accepted, this my hope only. Because i got these kind of problem in my application. That's why i mentioned.
Thanx for your help guyz but i just find out that i was using the wrong api, I have corrected that and now its good to go !!!
Please post what you did to fix the issue and mark it as the answer. this helps other people when they stumble upon this post searching for answers
@Malachi: In my answer i mentioned clearly what i was done. Did you expect more?
|
0

Clean your project: Project->Clean

Also, make sure you did not import "android.R". Eclipse tends to add this sometimes when you manage the imports.

2 Comments

Thanx for your help guyz but i just find out that i was using the wrong api, I have corrected that and now its good to go !!!
Thanx for your help guyz but i just find out that i was using the wrong api, I have corrected that and now its good to go !!!
0

when you add a resource to the project you have to update the XML Files associated with it. it will be in a folder probably named res in that folder will be several other folders called drawable layout and values they have XML Files inside them that need to be updated when you ad a resource such as a picture or a string to your project.

I might have the folders wrong, it has been a while since I programmed in Android.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.