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.

Error inflating class com.google.android.material.appbar.SubtitleCollapsingToolbarLayout

See original GitHub issue
implementation "com.google.android.material:material:1.5.0"
implementation "com.hendraanggrian.material:collapsingtoolbarlayout-subtitle:1.3.0-SNAPSHOT"
java.lang.RuntimeException: Unable to start activity ComponentInfo{care.viva.app/care.viva.app.profissional.views.ReciboActivity}: android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class com.google.android.material.appbar.SubtitleCollapsingToolbarLayout
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:169)
        at android.app.ActivityThread.main(ActivityThread.java:6521)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
     Caused by: android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class com.google.android.material.appbar.SubtitleCollapsingToolbarLayout
     Caused by: android.view.InflateException: Binary XML file line #17: Error inflating class com.google.android.material.appbar.SubtitleCollapsingToolbarLayout
     Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Constructor.newInstance0(Native Method)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
        at android.view.LayoutInflater.createView(LayoutInflater.java:647)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
        at care.viva.app.databinding.ActivityReciboBinding.inflate(ActivityReciboBinding.java:184)
        at care.viva.app.databinding.ActivityReciboBinding.inflate(ActivityReciboBinding.java:178)
        at care.viva.app.profissional.views.ReciboActivity.onCreate(ReciboActivity.kt:39)
        at android.app.Activity.performCreate(Activity.java:7051)
        at android.app.Activity.performCreate(Activity.java:7042)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1215)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:169)
        at android.app.ActivityThread.main(ActivityThread.java:6521)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
     Caused by: java.lang.IllegalAccessError: Field 'com.google.android.material.resources.TextAppearance.textColor' is inaccessible to class 'com.google.android.material.internal.SubtitleCollapsingTextHelper' (declaration of 'com.google.android.material.internal.SubtitleCollapsingTextHelper' appears in /data/app/care.viva.app-LvNQ-soKPeFPmhHXCBr0Fw==/base.apk!classes18.dex)
        at com.google.android.material.internal.SubtitleCollapsingTextHelper.setExpandedTitleTextAppearance(SubtitleCollapsingTextHelper.java:356)
        at com.google.android.material.appbar.SubtitleCollapsingToolbarLayout.<init>(SubtitleCollapsingToolbarLayout.java:132)
2022-02-22 10:38:21.594 10181-10181/care.viva.app E/AndroidRuntime:     at com.google.android.material.appbar.SubtitleCollapsingToolbarLayout.<init>(SubtitleCollapsingToolbarLayout.java:84)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:2
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
baolecommented, Mar 11, 2022

It’s because the material library v1.5.0 changed its API. I created a PR https://github.com/hendraanggrian/collapsingtoolbarlayout-subtitle/pull/41 to fix it.

@hendraanggrian could you have a look?

1reaction
hendraanggriancommented, Jul 1, 2022

Version 1.5.0-SNAPSHOT has been released. I will also publish the release version soon. I’ll be glad if you guys can try it first and see what am I missing in this version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error inflating class com.google.android.material.appbar ...
It's coming from Material components -> com.google.android.material as you can see so, that's why you get the error.
Read more >
Error inflating class CollapsingToolbarLayout - android studio ...
My CollapsingToolbarLayout crashes because of Error inflating class android.support.design.widget.CollapsingToolbarLayout. I updated the android studio to ...
Read more >
I'm getting a "Error inflating class com.google.android.material ...
Coding example for the question I'm getting a "Error inflating class com.google.android.material.navigation.NavigationView"-kotlin.
Read more >
App bars: top - Material Design
The top app bar displays information and actions relating to the current view. ... Class definition. AppBarLayout ... <com.google.android.material.appbar.
Read more >
AppBarLayout | Android Developers
AppBarLayout is a vertical LinearLayout which implements many of the features of material designs app bar concept, namely scrolling gestures ...
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