score:14

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 "com.android.support:appcompat-v7:21.0.+"
}

and then you can use:

values/themes.xml:

<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. -->

</style>

More info here: http://android-developers.blogspot.com/2014/10/appcompat-v21-material-design-for-pre.html

score:15

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