Dimension xml, unable to build "error: 'float|fraction' is an invalid format."

Viewed 588

After updating android studio to 3.0 and updating build tool version from '25.0.0' to '26.0.2', I'm getting this error msg 'float|fraction' is an invalid format. Basically unable to build the code.
My dimen item is:
<item name="default_key_width" format="float|fraction" type="dimen">10%p</item>.
Need some workaround. Also if I change float|fraction to float then I get error msg as invalid type: dimen. Please help.

2 Answers

You should use 10.0 instead of 10%p.

<item name="default_key_width" format="float" type="dimen">10.0</item>

After that, Clean-Rebuild-RUN.

Making it 10.0 creates some problem. Solved it by removing format and replacing %p with only %.

    <item name="default_key_width" type="dimen">10%</item>
Related