Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 6: TypedValue{t=0x2/d=0x101009b a=1}

Viewed 7984

I'm seeing the follow exception,

It only occurs when the Android SDK api level is 26, but it's ok in lower version.

Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute
    at index 6: TypedValue{t=0x2/d=0x101009b a=1}
    at android.content.res.TypedArray.getColorStateList(TypedArray.java:538)
    at android.widget.TextView.<init>(TextView.java:904)
    at android.widget.TextView.<init>(TextView.java:818)
    at android.widget.TextView.<init>(TextView.java:814)

The xml file is

<TextView
        android:id="@+id/tv_app_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerInParent="true"
        android:text="@string/app_name"
        android:textColor="@color/black"
        android:textSize="@dimen/large" />

The Activity style is

<style name="HostCompatTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:elevation">0dp</item>
    <item name="android:buttonStyle">@style/NoShadowButton</item>
</style>

activity which uses this extends Activity, not ActionBarActivity. Any ideas why is it generating an error?

1 Answers
Related