hikmet_anil
hikmet_anil

Reputation: 99

'1' is incompatible with attribute textSize (attr) dimension

I can not change my code before this problem. But, it is occured when I build my project. I can not solve and understand what it is? Could you help me, please? I use Android Studio 3.2.1

Output:  
C:\Users\Lenovo\AndroidStudioProjects\Paintmet\app\src\main\res\drawable- 
v24\ic_launcher_foreground.xml:7: error: '1' is incompatible with attribute 
textSize (attr) dimension.

v21\ic_launcher_background.xml:10: error: '0.8' is incompatible with 
attribute textSize (attr) dimension.
...

Upvotes: 2

Views: 7086

Answers (2)

hikmet_anil
hikmet_anil

Reputation: 99

At last I found the answer. The answer is delete to drawable folder in res folder. And then copy to other project drawable folder to there.

Upvotes: 0

TheWanderer
TheWanderer

Reputation: 17854

You need a unit, such as sp, dp or px.

The recommendation is to use sp for text, as this will scale with the system font size and the system density. 1 and 0.8 will be tiny, though. You'll want at least 14sp.

android:textSize="18sp"

Upvotes: 5

Related Questions