Skip to content
This repository has been archived by the owner on Jun 22, 2022. It is now read-only.

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

Closed
Stupidman22 opened this issue Apr 15, 2021 · 8 comments

Comments

@Stupidman22
Copy link

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)

@akexorcist
Copy link
Owner

akexorcist commented Apr 18, 2021

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.

@Stupidman22
Copy link
Author

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

@tobi512
Copy link

tobi512 commented Apr 19, 2021

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!

@akexorcist
Copy link
Owner

akexorcist commented Apr 19, 2021

@tobi512 Yes, fixed (see #93).

@akexorcist
Copy link
Owner

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

@Stupidman22
Copy link
Author

@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.

@akexorcist
Copy link
Owner

@Stupidman22 Roger that

@akexorcist
Copy link
Owner

I opened your latest issue reporting in #113.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants