These properties are intended to work with Android 21, Material Theme thus you cannot use them in values/styles.xml. Instead, you should put them in values-v21/styles.xml.

If you want to implement Material Design in previous versions of android you should include compatibility library:

dependencies {
    compile ""

and then you can use:


<style name="Theme.MyTheme" parent="Theme.AppCompat.Light">
    <!-- colorPrimary is used for the default action bar background -->
    <item name=”colorPrimary”>@color/my_awesome_color</item>

    <!-- colorPrimaryDark is used for the status bar -->
    <item name=”colorPrimaryDark”>@color/my_awesome_darker_color</item>

    <!-- colorAccent is used as the default value for colorControlActivated,
         which is used to tint widgets -->
    <item name=”colorAccent”>@color/accent</item>

    <!-- You can also set colorControlNormal, colorControlActivated
         colorControlHighlight, and colorSwitchThumbNormal. -->


More info here:


Remove the android prefix before the color name. So it will be:

<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primary_dark</item>
<item name="colorAccent">@color/accent</item>    

Related Query

More Query from same tag