No resource was found that matches the specified name '@ style / Theme.Holo.Light.DarkActionBar'

Platform: 4.3

API Level: 18

AndroidManifest.xml:

<uses-sdk android:minSdkVersion="18" android:targetSdkVersion="18" /> 

values-v14 \ styles.xml:

  <resources> <!-- 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"> </style> <style name="CustomActionBarTheme" parent="@style/Theme.Holo.Light.DarkActionBar"> <item name="android:actionBarStyle">@style/MyActionBar</item> </style> <style name="MyActionBar" parent="@style/Widget.Holo.Light.ActionBar.Solid.Inverse"> <item name="android:background">@drawable/actionbar_background</item> </style> 

I am a newbie android. Thank you so much!

+51
android
Aug 22 '13 at 2:37 on
source share
7 answers

Do it:

 "android:style/Theme.Holo.Light.DarkActionBar" 

You missed the android keyword before the style. This means that it is an inline style for Android.

+86
Aug 22 '13 at 2:42 on
source share

Make sure that you have installed the target API (other than the target SDK) in the project properties (and not in the manifest) of at least 4.0 / API 14.

+14
Dec 30 '14 at 9:49
source share

@android did not work for me. When I use android (without @), it works like a charm.

Example:

 <style name="CustomActionBarTheme" parent="android:style/Theme.Holo.Light.DarkActionBar"> 
+9
Jan 26 '14 at 9:38 on
source share

There is a big mistake in tutorials intended for beginners: http://developer.android.com/training/basics/actionbar/styling.html

This is important because it is almost impossible to find the cause of the error for beginners.

The error is that this guide clearly states that the tutorial is valid for level 11 level (Android 3.0), but in fact this is true only for Theme.Holo theme (without additional extensions and options)

But this tutorial uses Theme.holo.Light.DarkActionBar theme, which is only a valid theme from level 14 (Android 4.0) and above.

This is just one of many examples of errors found in these manuals (which are important at best). Someone needs to fix these errors this weekend because they are really expensive and annoying timethieves. If there is a way, I can send this information to the Android team, then please tell me and I will do it. Hopefully, however, they are reading Stackoverflow. (let me suggest: the Android team should consider putting someone new to experience all the tutorials as qualifications that they are valid).

Another mistake I (and countless other people) found is that the appcombat feedback matching module does not really work if you strictly follow the tutorials. The error is unknown. I had to refuse.

As for the error in this thread, here is a quote from the textbook with italics about the discrepancy:

"Only for Android 3.0 and higher

If you only support Android 3.0 and above, you can define the background of the action bar as follows:

  <resources> <!-- the theme applied to the application or activity --> <style name="CustomActionBarTheme" parent="@style/Theme.Holo.Light.DarkActionBar"> 

ERROR1: Only Theme.Holo can be used with Android 3.0. Therefore remove the "Light.DarkActionBar, etc.

ERROR2: @ style / Theme.Holo "> will not work. You must write @android: style / Theme.Holo"> to indicate that this is a built-in theme that is referenced. (Itโ€™s a little strange that โ€œbuilt-inโ€ is not the default, but need to be specified?)

The compiler's recommendation for error correction is to define a level of 14 api of at least sdk. This is not optimal, because it creates a mismatch between Andreoid 3.0 (level 11 api). So I only use Theme.Holo, and this seems to work fine (but new output, though).

I am using Netbeans with Android support. It works well.

+3
Feb 28 '14 at 14:18
source share

If you are using Android studio, this may be useful for you.

I had a similar problem and solved it by changing the default skd path: C: \ Program Files (x86) \ Android \ android-studio \ sdk to C: \ Program Files (x86) \ Android \ android- sdk.

It seems that the problem arose from the compiler version (gradle automatically sets it to the highest available in the sdk folder), which does not support this theme, and since Android studio only had api 7 in its sdk folder, it gave me this error.

More on how to change Android sdk path in Android Studio: Android Studio - How to change Android SDK path

+1
Jul 04 '14 at 10:43
source share

Also, if you try to use CustomActionBarTheme, make sure there are

 <application android:theme="@style/CustomActionBarTheme" ... /> 

in AndroidManifest.xml

not

 <application android:theme="@android:style/CustomActionBarTheme" ... /> 
0
Nov 22 '14 at 15:02
source share

You can change this parent attribute = "android: style / Theme.Holo.Light.DarkActionBar"

0
Nov 26 '15 at 7:49
source share



All Articles