Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not able to create new color item in colors.xml file

The error I am getting is : "The color "colorRed" in values has no declaration in the base values folder; this can lead to crashes when the resource is queried in a configuration that does not match this qualifier less... "

I have tried clean project and rebuild and also tried invalidate cache & restart but still that error not going.

I have attached screenshot of colors.xml file

enter image description here

like image 296
Krishna Ch Avatar asked Apr 16 '18 07:04

Krishna Ch


People also ask

How do you change the color of an XML file?

Android TextView – Text Color. TextView Text Color – To change the color of text in TextView, you can set the color in layout XML file using textColor attribute or change the color dynamically in Kotlin file using setTextColor() method.

Where is colors XML in Android Studio?

XML file saved at res/values/colors.

What is the name of the folder where you should save your colors XML?

The res/values folder is used to store the values for the resources that are used in many Android projects to include features of color, styles, dimensions etc. Below explained are few basic files, contained in the res/values folder: colors. xml: The colors.


1 Answers

I solved the problem cleaning the project and build it again. If it doesn't work, invalidate caches and restart.

I'm using Android Studio 3.2

Invalidate Caches with File > Invalidate Caches / Restart... > Invalidate and Restart

like image 93
pableiros Avatar answered Sep 23 '22 19:09

pableiros