Title: "dimension types not allowed" when I put float in dimen
Tags: android
Question: I added this line to my values/dimen.xml
<item format="float" name="list_divider_thickness" type="dimen"&gt;0.66dp</item&gt;
and I get
Error:(1015, 69) Dimension types not allowed (at 'list_divider_thickness' with value '0.66dp').
(I want a divider that appears as 2 pixels on xxhdpi , and 1 pixel on low/med density devices, that's why I'm using 0.66)


Here is another answer: for adding floats, we dont need to use the syntax in the original question, I changed it to
<dimen name="list_divider_thickness"&gt;0.66dp</dimen&gt;
and it worked fine.
It was android studio which automatically generated the entry the wrong way when I pressed alt+enter and selected extract dimension resource.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2017:00:03/03/17', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<android>', 'Title': '"dimension types not allowed" when I put float in dimen', 'ViewCount': 928, 'id': 42570003, 'user_AboutMe': '<p>Software engineer since 2009.\nStarting Android Development in 2012.\nCurrently working remotely for a company in San Fran.</p>\n', 'user_AccountId': 2350981.0, 'user_DisplayName': 'Siavash', 'user_Reputation': 7583.0, 'user_Views': 464.0, 'user_id': 2059819.0}}