I’m developing an Android app, that uses sereval libraries in que. That means:
- Project A is ibrary.
- Project B uses library A and is library.
- Project C users library B.
Now in Project A or B i try to define attributes for custom views. Since SDK 17, there should be no more problems with the namespace. When I make a declare-styleable, my R.class is generated automatically as excpected and the defined attributes listed up in the R.class, so I don’t excpect any error in the xml-Files. (Normally, the R.class is not generated after clean project, when there is an error in the xml.)
Now the strange thing is, that I got an error in the R.class itself. The last } to complete the class is not built. If I insert it manually, it’s removed automatically after a fiew seconds.
Here is my attrs.xml file:
<?xml version="1.0" encoding="utf-8"?>
<declare-styleable name="ContentBox">
<attr name="distanceToText" format="dimension" />
<attr name="distanceBetweenText" format="dimension" />
<attr name="titleColor" format="color" />
<attr name="textColor" format="color"></attr>
<attr name="textSizeTitle" format="dimension"></attr>
<attr name="textSizeText" format="dimension"></attr>
<attr name="paddingVerticalTitle" format="dimension"></attr>
<attr name="paddingLeftTitle" format="dimension"></attr>
<attr name="paddingHorizontalText" format="dimension"></attr>
<attr name="titleBackgroundColor" format="color"></attr>
<attr name="frameColor" format="color"></attr>
<attr name="backgroundColorClickable" format="color"></attr>
<attr name="title" format="string"></attr>
<attr name="textSizeColumnOne" format="dimension"></attr>
<attr name="textSizeColumnTwo" format="dimension"></attr>
<attr name="textColorColumnOne" format="color"></attr>
<attr name="textColorColumnTwo" format="color"></attr>
<attr name="distanceBetweenTextHoriz"></attr>
</declare-styleable>
Has anyone an idea?
I found the mistake. In the last line, there is no format defined, that ends in the error with the R.class…