Failed to inflate ColorStateList, leaving it to the framework java.lang.UnsupportedOperationException: Can't convert to color: type=0x2 : <p>I have a login part and I use TextInputLayout for email and password. Both of them are the same. Also I use Data binding to show the Error message.</p>

<p>The error is happening on API &lt; 20 when it should show an Error Hint.</p>

<pre><code>    @Override
    public void showEmailError() {
        inputLayoutEmail.setError(sInvalidEmail);
    }
</code></pre>

<p><strong>xml layout :</strong> </p>

<pre><code>        &lt;android.support.design.widget.TextInputLayout
            android:id="@+id/til_email"
            android:layout_height="wrap_content"
            android:layout_width="match_parent"
            android:layout_marginLeft="@dimen/default_margin_16dp"
            android:layout_marginRight="@dimen/default_margin_16dp"
            android:layout_marginTop="16dp"
            android:layout_below="@id/login_img_logo"
            android:layout_centerHorizontal="true"
            android:textColorHint="@color/gray"
            android:background="@drawable/login_edittext"
            android:errorEnabled="@{viewmodel.obEmailErrorVisibility}"
            &gt;

            &lt;EditText
                android:id="@+id/et_login"
                android:layout_height="@dimen/login_view_height"
                android:layout_width="@dimen/login_view_width"
                android:inputType="text"
                android:maxLength="50"
                android:hint="@string/activity_login_hint_email"
                android:text="@={viewmodel.email}"
                android:textColor="@color/black"
                android:textColorHint="@color/gray"
                android:paddingLeft="@dimen/default_margin_16dp"
                android:enabled="@{viewmodel.obIsEmailFieldEnabled}"
                /&gt;

        &lt;/android.support.design.widget.TextInputLayout&gt;

        &lt;android.support.design.widget.TextInputLayout
            android:id="@+id/til_password"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="@dimen/default_margin_16dp"
            android:layout_marginRight="@dimen/default_margin_16dp"
            android:layout_marginTop="@dimen/default_margin_8dp"
            android:layout_below="@id/til_email"
            android:layout_centerHorizontal="true"
            android:textColorHint="@color/gray"
            android:background="@drawable/login_edittext"
            android:errorEnabled="@{viewmodel.obPassErrorVisibility}"
            &gt;

            &lt;EditText
                android:id="@+id/et_password"
                android:layout_width="@dimen/login_view_width"
                android:layout_height="@dimen/login_view_height"
                android:hint="@string/activity_login_hint_password"
                android:maxLength="50"
                android:inputType="textPassword"
                android:text="@={viewmodel.password}"
                android:textColor="@color/black"
                android:textColorHint="@color/gray"
                android:paddingLeft="@dimen/default_margin_16dp"
                android:enabled="@{viewmodel.obIsPassFieldEnabled}"
                /&gt;

        &lt;/android.support.design.widget.TextInputLayout&gt;
</code></pre>

<p>as background I use 
<strong>login_edittext.xml</strong></p>

<p></p>

<pre><code>&lt;solid android:color="@color/white" /&gt;

&lt;corners
    android:radius="@dimen/login_edittext_radius"
    /&gt;
</code></pre>

<p></p>

<p>I have check similar answers, but most of them are related to <strong>styles</strong></p>

<p><a href="https://stackoverflow.com/questions/27986204/cant-convert-to-color-type-0x2-error-when-inflating-layout-in-fragment-but-onl">Can&#39;t convert to color: type=0x2 error when inflating layout in fragment but only on Samsung Galaxy and Note 4</a></p>
