I keep getting an error in my android project - android

I keep getting an error the values-v11 folder on the style.xml The error says:
error: Error Retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light.DarkActionBar'
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- API 14 theme customizations can go here. -->
</style>
I'm using Android SDK 2.3

With android sdk 2.3 you can not control or change behavior of action bar..
for that min sdk should be sdk 3.0 or above.
for further you can see this documentation.

Related

Project ActionBar Error After Google Play Service Update

I have the following error after updating Google Play Services:
[2015-12-19 10:58:19 - google-play-services_lib] C:\Tools\Android\sdk_24\extras\google\google_play_services\libproject\google-play-services_lib\res\values-v11\appinvite_styles.xml:5: error: Error retrieving parent for item: No resource found that matches the given name '#android:style/Theme.Holo.Light.DialogWhenLarge.NoActionBar'.
[2015-12-19 10:58:19 - google-play-services_lib] C:\Tools\Android\sdk_24\extras\google\google_play_services\libproject\google-play-services_lib\res\values-v21\appinvite_styles.xml:5: error: Error retrieving parent for item: No resource found that matches the given name '#android:style/Theme.Material.Light.DialogWhenLarge.NoActionBar'.
Styles.xml:
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
I had already imported appcompat_v7. Everything was working fine before the google play service import.
I had same problem, only that I have found in google code groups was to move to old lib version
Ok I downloaded an older version of Google Play Services as per this answer:
How to download older google play services?
Removed my updated version (from eclipse and disk)
Imported r27 release into Eclipse
No more updating anything again!

Error with Gyrobot project for android in Github [duplicate]

below is my xml file.It gives me err saying thaty "error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light.DarkActionBar'."
<!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- API 14 theme customizations can go here. -->
</style>
Change parent attribute to parent="android:style/Theme.Holo.Light.DarkActionBar"
Right-click your project in the Package Explorer > select Properties > select Android > and set Project Build Target to API level 14 or higher.
Right Click your project->properties->Android, then Add android-support-v7-appcompat
You can import this library from your android-sdk folder->extras->android->support->v7->appcompat

error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.NoActionBar'

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="android:textColorPrimary">#color/colorTextPrimary</item>
<item name="android:textColorSecondary">#color/colorTextSecondary</item>
</style>
This is the styles.xml file. The following code results in this error - i have put all the necessary libraries and jar files and i have also tried changing the syntax little bit and many stuff but I am not able to solve the problem. It is very important. Please help me. Thank you.
I have tried the following :
You need to reference this AppCompat library in your Android project.
Import the library into Eclipse.
Right click on your Android project.
Select properties.
Click 'add...' at the bottom to add a library.
Select the support library
Clean and rebuild your project.
It still doesn't work.
Edit now :
I have installed android sdk 5.0 (API 21) but it still doesn't work. The line with the error is
There were 3 other errors before installing android sdk 5.0 (API 21) in this file (styles.xml) but now they are gone. Please help me to remove the remaining error.
If you are using material in the manifest, you will get this error if your min version isn't API 21

No resource found that matches the given name 'android:Theme.Holo.Light.DarkActionBar'

below is my xml file.It gives me err saying thaty "error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light.DarkActionBar'."
<!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- API 14 theme customizations can go here. -->
</style>
Change parent attribute to parent="android:style/Theme.Holo.Light.DarkActionBar"
Right-click your project in the Package Explorer > select Properties > select Android > and set Project Build Target to API level 14 or higher.
Right Click your project->properties->Android, then Add android-support-v7-appcompat
You can import this library from your android-sdk folder->extras->android->support->v7->appcompat

Using different resource files depending of the SDK API level (using Eclipse)?

I am writing an Android app, targeting API levels 8 to 14. I want to use the Theme.Holo.Light theme for API level 11 and higher, and a Theme.Light theme for lower API levels.
The content of res/values/style.xml is:
<resources>
<style name="AppTheme" parent="android:Theme.Light" />
</resources>
and the content of res/values-v11/style.xml is:
<resources>
<style name="AppTheme" parent="android:Theme.Holo.Light" />
</resources>
This compiles well for API level 14, but when setting my target API level to 8, it gives the following error: "Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo'" in res/values-v11/style.xml, and "Android AAPT Problem".
If I remove the file res/values-v11/style.xml, the app compiles correctly for API level 8 target.
Now, my understanding is that when compiling for API level 8 the build system should ignore anything inside a resource folder whose name ends with "-v11".
What am I doing wrong?
It's because API 8 got no clue what Theme.Holo.Light is as it was introduced in API11. You have to compile against highest API version you use elements of.
And you understand resource selectors wrong. It's is not used for build the app conditionally. It's used to pick up right resource at runtime.
See this article.

Categories

Resources