question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inflate error - cannot parse TextView

See original GitHub issue

version: 6.1 (apparently, it’s also broken)

Calling

snackProgressBarManager.show(snackProgressBar, SnackProgressBarManager.LENGTH_INDEFINITE)

produces

 android.view.InflateException: Binary XML file line #129: Error inflating class TextView
...
... (lots of logs)
...
Caused by: java.lang.RuntimeException: Failed to resolve attribute at index 5
        at android.content.res.TypedArray.getColorStateList(TypedArray.java:425)
        at android.widget.TextView.<init>(TextView.java:1032)
        at android.widget.TextView.<init>(TextView.java:674)
        at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:99)
        at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:95)
        at androidx.appcompat.app.AppCompatViewInflater.createTextView(AppCompatViewInflater.java:182)
        at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:103)
        at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1371)
        at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1421)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:725)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:809) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:504) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
        at com.tingyik90.snackprogressbar.SnackProgressBarCore$Companion.make$lib_release(SnackProgressBarCore.kt:71) 
        at com.tingyik90.snackprogressbar.SnackProgressBarManager.playQueue(SnackProgressBarManager.kt:552) 
        at com.tingyik90.snackprogressbar.SnackProgressBarManager.addToQueue(SnackProgressBarManager.kt:517) 
        at com.tingyik90.snackprogressbar.SnackProgressBarManager.show(SnackProgressBarManager.kt:263) 
        at pl.baftek.discoverrudy.place.PlaceActivity.showSnackbar(PlaceActivity.kt:325) 
        at pl.baftek.discoverrudy.place.PlaceActivity.showVisits(PlaceActivity.kt:279) 
        at pl.baftek.discoverrudy.place.PlaceActivity.access$showVisits(PlaceActivity.kt:36) 
        at pl.baftek.discoverrudy.place.PlaceActivity$onCreate$12.onClick(PlaceActivity.kt:165) 
        at android.view.View.performClick(View.java:4764) 
        at android.widget.CompoundButton.performClick(CompoundButton.java:125) 
        at android.view.View$PerformClick.run(View.java:19844) 
        at android.os.Handler.handleCallback(Handler.java:739) 
        at android.os.Handler.dispatchMessage(Handler.java:95) 
        at android.os.Looper.loop(Looper.java:135) 
        at android.app.ActivityThread.main(ActivityThread.java:5349) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:372) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703) 

Looks like something related to the TextView on SnackProgressBar.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
tingyik90commented, Jul 30, 2019

@Anvipo @bartekpacia, I finally have time to clone the repo and did some test. Apparently, this is an issue from your side where you did not declare <color name="colorAccent">#03A9F4</color> in your res. The name color name="accent" was used which caused the property lookup to fail.

Internally, colors.xml is looking up what colorAccent is applied by the user via ?attr/colorAccent. You can easily fix this by just adding colorAccent into your colors.xml. Please try and let me know if it solves your problem.

0reactions
Anvipocommented, Aug 2, 2019

@tingyik90, yep, I got this, thank you. I’ve renamed color “accent” to “colorAccent” and it works. P.S. That was funny. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error inflating TextView in Android Studio - Stack Overflow
Your problem is. Error inflating TextView. So we check TextView first . In your code .You just use mains = (TextView) rowView.
Read more >
Applying Data Binding for Views | CodePath Android Cliffnotes
If you see an error message such as cannot resolve symbol 'ActivityMainBinding' then this means that the data binding auto-generated class has not...
Read more >
How to implement the onactivitycreated() well on android ...
I have a fragment hosted by an activity. The fragment makes use of my Activity's EditText(uses view from Activity). and also uses the...
Read more >
android.view.LayoutInflater.inflate java code examples - Tabnine
LAYOUT_INFLATER_SERVICE); View v = vi.inflate(R.layout.your_layout, null); // fill in any details dynamically here TextView textView = (TextView) v.
Read more >
View - Android Developers
This method is typically called by a view on itself when it believes that it can no longer fit within its current bounds....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found