Recently transferred a project from Eclipse to Android Studio.
The project uses some XML resources in the ring-letter demo, and after the conversion, it is found that the label of the color resource directory such as layer-list or shape, element XXX must be declared error, The main idea is that layer-list or shape these tags are undefined.
These tags, such as layer-list or shape, are frequently used tags, and Android studio reports undefined errors, which are not the problem in eclipse. Many people on the web say that this is a bug in Android studio, which is the opposite, and this is the advantage of Android Studio.
The first thing you need to know about this problem is what these tags are, such as layer-list, shape, and so on.
Each label has a corresponding resource class, and layer-list, shape, and so on are the actual drawable resources that the tag represents. Layer-list finally resolves to layerdrawable,shape will resolve to shapedrawable. Other tags are similar.
It can be seen that layer-list or shape and other resources are drawable resources, should be placed in the Drawable resource directory. The color resource does not contain a drawable resource and, of course, does not define a label for the drawable type.
Unlike Android Studio, Eclipse does not have a strict check on resource types, so there is no reporting error. I think this is the advantage of Android Studio, is what resources should be put to where, not easy to people create doubts. So the solution under Android Studio is to move these resource files to the drawable resource directory. Solve this problem.
Troubleshoot Android Studio under element Layer-list must be declared issues