Couldn't resolve resource @color/colorAccent

Shubhang Agarwal picture Shubhang Agarwal · Mar 15, 2017 · Viewed 8.4k times · Source

I got this error. Would somebody know how to fix it. All i had written

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="background_color">#009688</color>
    <color name="white">#FFFFFF</color>
    <color name="black">#000000</color>
    <color name="white_greyish">#EEEEEE</color>
    <color name="button_selectorcolor">#9E9E9E</color>
</resources>

Answer

Murtuza Khan picture Murtuza Khan · Mar 15, 2017

As your colors resource XML is not showing the color you want to use i.e., colorAccent so add this color in your colors.xml file like this:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="background_color">#009688</color>
    <color name="white">#FFFFFF</color>
    <color name="black">#000000</color>
    <color name="white_greyish">#EEEEEE</color>
    <color name="button_selectorcolor">#9E9E9E</color>
    <color name="colorAccent">YOUR_DESIRED_COLOR_CODE</color>
</resources>