Android Studio logger TextView TypeFace style 0

AndroidAndroid StudioTextviewLogcatTypeface

Android Problem Overview


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.

Android Solutions


Solution 1 - Android

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.

Solution 2 - Android

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionanatoliView Question on Stackoverflow
Solution 1 - AndroidRichard GreenView Answer on Stackoverflow
Solution 2 - AndroidMartin ZeitlerView Answer on Stackoverflow