java.lang.UnsupportedOperationException: Can't convert to color: type=0x2

Hot problem!
This exception has a lot of traffic. You can help 22 users by writing a short tip.

Solutions on the web

Solution icon of stackoverflow
Can't convert to color: type=0x2

Solution icon of github
via GitHub by passadoreg
, 1 year ago
Can't convert to color: type=0x2

Solution icon of github
via GitHub by TunTunAg
, 1 year ago
Can't convert to color: type=0x2

Solution icon of github
Can't convert to color: type=0x2

Solution icon of github
via GitHub by Neamar
, 11 months ago
Can't convert to color: type=0x2

Solution icon of github
Can't convert to color: type=0x2

Solution icon of github
Can't convert to color: type=0x2

Solution icon of stackoverflow
Can't convert to color: type=0x2

Solution icon of stackoverflow
Can't convert to color: type=0x2


Stack trace

java.lang.UnsupportedOperationException: Can't convert to color: type=0x2
	at android.content.res.TypedArray.getColor(TypedArray.java:326)
	at android.support.v7.content.res.AppCompatColorStateListInflater.inflate(AppCompatColorStateListInflater.java:114)
	at android.support.v7.content.res.AppCompatColorStateListInflater.createFromXmlInner(AppCompatColorStateListInflater.java:88)
	at android.support.v7.content.res.AppCompatColorStateListInflater.createFromXml(AppCompatColorStateListInflater.java:67)
	at android.support.v7.content.res.AppCompatResources.inflateColorStateList(AppCompatResources.java:116)
	at android.support.v7.content.res.AppCompatResources.getColorStateList(AppCompatResources.java:74)
	at android.support.v7.widget.TintTypedArray.getColorStateList(TintTypedArray.java:136)
	at android.support.v7.widget.AppCompatTextHelper.onSetTextAppearance(AppCompatTextHelper.java:157)
	at android.support.v7.widget.AppCompatTextView.setTextAppearance(AppCompatTextView.java:148)
	at android.support.v4.widget.TextViewCompatGingerbread.setTextAppearance(TextViewCompatGingerbread.java:103)
	at android.support.v4.widget.TextViewCompat$BaseTextViewCompatImpl.setTextAppearance(TextViewCompat.java:86)
	at android.support.v4.widget.TextViewCompat.setTextAppearance(TextViewCompat.java:283)
	at android.support.design.widget.TextInputLayout.setErrorEnabled(TextInputLayout.java:607)
	at android.support.design.widget.TextInputLayout.setError(TextInputLayout.java:693)
	at android.support.design.widget.TextInputLayout.setError(TextInputLayout.java:680)
	at my.package.databinding.ActivityProductEditBinding.executeBindings(ActivityProductEditBinding.java:394)
	at android.databinding.ViewDataBinding.executePendingBindings(ViewDataBinding.java:355)
	at my.package.activities.ProductEditActivity$2.prepareToSave(ProductEditActivity.java:62)
	at my.package.activities.ProductEditActivity$2.prepareToSave(ProductEditActivity.java:45)
	at my.package.listeners.SaveListener.onSave(SaveListener.java:22)
	at my.package.databinding.ActivityProductEditBinding._internalCallbackOnClick(ActivityProductEditBinding.java:438)
	at android.databinding.generated.callback.OnClickListener.onClick(OnClickListener.java:11)
	at android.view.View.performClick(View.java:4204)
	at android.view.View$PerformClick.run(View.java:17355)
	at android.os.Handler.handleCallback(Handler.java:725)
	at android.os.Handler.dispatchMessage(Handler.java:92)
	at android.os.Looper.loop(Looper.java:137)
	at android.app.ActivityThread.main(ActivityThread.java:5041)
	at java.lang.reflect.Method.invokeNative(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:511)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
	at dalvik.system.NativeStart.main(Native Method)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Once, 7 months ago
4 times, 7 months ago
Samebug visitor profile picture
Unknown user
Once, 3 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 11 months ago
11 more bugmates