marina
marina

Reputation: 1680

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.

Upvotes: 53

Views: 9209

Answers (2)

Richard Green
Richard Green

Reputation: 409

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.

Upvotes: 30

Martin Zeitler
Martin Zeitler

Reputation: 76799

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.

Upvotes: 11

Related Questions