akexorcist/Localization

java.lang.UnsupportedOperationException: Failed to resolve attribute at index 37: TypedValue{t=0x2/d=0x7f04024a a=-1}

Stupidman22 opened this issue ยท 8 comments

Device Qos (some samsung devices). Issue cause when you using androidx.appcompat.app.AlertDialog
Hope you can fix it soon. Thank you
[Plus at this time for any one face the same issue like me. Please override
@style/MyDialogTheme to your app theme. It will work. ]

layout/select_dialog_singlechoice_material: Error inflating class CheckedTextView
Caused by: android.view.InflateException: Binary XML file line #18 in com.vietbm.computerlauncher:layout/select_dialog_singlechoice_material: Error inflating class CheckedTextView
Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 37: TypedValue{t=0x2/d=0x7f04024a a=-1}
at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:782)
at android.view.View.(View.java:6222)
at android.widget.TextView.(TextView.java:1247)
at android.widget.CheckedTextView.(CheckedTextView.java:102)
at android.widget.CheckedTextView.(CheckedTextView.java:98)
at androidx.appcompat.widget.AppCompatCheckedTextView.(AppCompatCheckedTextView.java:58)
at androidx.appcompat.widget.AppCompatCheckedTextView.(AppCompatCheckedTextView.java:53)
at androidx.appcompat.app.AppCompatViewInflater.createCheckedTextView(AppCompatViewInflater.java:234)
at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:147)
at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1551)
at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1602)
at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1059)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:995)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:959)
at android.view.LayoutInflater.inflate(LayoutInflater.java:657)
at android.view.LayoutInflater.inflate(LayoutInflater.java:532)
at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:425)
at android.widget.ArrayAdapter.getView(ArrayAdapter.java:416)
at android.widget.AbsListView.obtainView(AbsListView.java:2629)
at android.widget.ListView.measureHeightOfChildren(ListView.java:1452)
at android.widget.ListView.onMeasure(ListView.java:1358)
at android.view.View.measure(View.java:27131)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7951)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:27131)
at androidx.appcompat.widget.AlertDialogLayout.tryOnMeasure(AlertDialogLayout.java:134)
at androidx.appcompat.widget.AlertDialogLayout.onMeasure(AlertDialogLayout.java:64)
at android.view.View.measure(View.java:27131)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7951)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at androidx.appcompat.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:146)
at android.view.View.measure(View.java:27131)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7951)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:27131)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7951)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:27131)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7951)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
at android.view.View.measure(View.java:27131)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:7951)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at com.android.internal.policy.DecorView.onMeasure(DecorView.java:1173)
at android.view.View.measure(View.java:27131)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:4187)

Could you tell me more about which library version and how do you implement the app theme in your project?

Because the latest version solved #93 that similar to your issue and I need more information. Only stack track is not enough to reproduce this problem.

Hi, my mistake. I had tried the lastest version. It still have this issue. To reproduce this issue please showing any androidx.appcompat.app.AlertDialog to test. Thank you

Hi there, we're facing the same problem since updating from 1.2.6 to 1.2.7 (in our case when displaying a Snackbar).
Took quite a while to find this issue here ๐Ÿ˜„

Stacktrace:

Binary XML file line #26: Binary XML file line #26: Error inflating class TextView

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:569)
    at android.widget.TextView.<init>(TextView.java:984)
    at android.widget.TextView.<init>(TextView.java:889)
    at androidx.appcompat.widget.AppCompatTextView.<init>(SourceFile:100)
    at androidx.appcompat.widget.AppCompatTextView.<init>(SourceFile:95)
    at androidx.appcompat.app.AppCompatViewInflater.createTextView(SourceFile:194)
    at androidx.appcompat.app.AppCompatViewInflater.createView
    at androidx.appcompat.app.AppCompatDelegateImpl.createView(SourceFile:1551)
    at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(SourceFile:1602)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:783)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:874)
    at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:835)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
    at com.google.android.material.snackbar.Snackbar.makeInternal(SourceFile:209)
    at com.google.android.material.snackbar.Snackbar.make(SourceFile:157)

Does the latest version already fix that?

Cheers!

@tobi512 Yes, fixed (see #93).

1.2.10 is live. please check on your project and don't forget to give me a feedback.

@akexorcist
Hello the issue about dialog had been fix. But there have new issue in android Q and R OS
If using <style name="TestAppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
i mean using DayNight theme apply for Activity when change dark mode. If using lastest version 1.2.10 activity theme not auto change when turn on dark mode in settings.

@Stupidman22 Roger that

I opened your latest issue reporting in #113.