Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio logger TextView TypeFace style 0

In my project, I receive the following in a logcat message, for each TextView in all views of my app:

D/TextView: setTypeface with style : 0 

The theme I used in styles.xml:

<style name="GreenTheme" parent="Base.Theme.AppCompat.Light">     <item name="colorPrimary">@color/primaryGreen</item>     <item name="colorPrimaryDark">@color/primaryDarkGreen</item>     <item name="colorAccent">@color/accentGreen</item>      <item name="windowActionBar">false</item>     <item name="windowNoTitle">true</item> </style> 

I also use buildToolsVersion "26.0.1"

I have also tried to use Theme.AppCompat.Light.NoActionBar as the parent theme. The messages still get logged.

UPDATE 1

After some tests i have found that this occurs only with *.Theme.AppCompat.Light.* themes.

Theme.AppCompat.Light.NoActionBar is most often used and comes in every tutorial for material design.

How can this issue be fixed?

UPDATE 2

Note: When using an emulator, this message does not show. It's most likely a device issue.

like image 600
anatoli Avatar asked Sep 28 '17 08:09

anatoli


2 Answers

On logcat, right click and select "Fold lines like this" then edit down that line to just the bit from "TextView..." - then they all disappear.

like image 133
Richard Green Avatar answered Sep 19 '22 18:09

Richard Green


this might be a Samsung specific issue. you probably could try to replace all instances of TextView with AppCompatTextView and see if those warnings get any less... while this is just a wild guess.

would suggest to mute the noise; goto Logcat > Edit Filter Configuration and then include the packagename (in order to resemble the option "Show only selected application") - and exclude that annoying tag with an exclusive regular expression, alike: ^(?!TextView) or exclude by log message ^(?!setTypeface\swith\sstyle\s:\s0).this should reduce the amount of log spam.

like image 37
Martin Zeitler Avatar answered Sep 20 '22 18:09

Martin Zeitler