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.tbuonomo.morphbottomnavigation.MorphBottomNavigationView

See original GitHub issue

This is my first time I’m using a Bottom Navigation View in my app. I did the following steps:

  1. Added Dependedncy
  2. Copied com.tbuonomo.morphbottomnavigation.MorphBottomNavigationView in my XML
  3. Copy pasted 2 styles created in the sample project
  4. Added drawables

Now when I run my app I get the following error: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ahsanwrites.travearner/com.ahsanwrites.travearner.MainActivity}: android.view.InflateException: Binary XML file line #36: Binary XML file line #36: Error inflating class com.tbuonomo.morphbottomnavigation.MorphBottomNavigationView at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2792) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2870) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1601) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:172) at android.app.ActivityThread.main(ActivityThread.java:6590) 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 #36: Binary XML file line #36: Error inflating class com.tbuonomo.morphbottomnavigation.MorphBottomNavigationView Caused by: android.view.InflateException: Binary XML file line #36: Error inflating class com.tbuonomo.morphbottomnavigation.MorphBottomNavigationView 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.inflate(LayoutInflater.java:515) at android.view.LayoutInflater.inflate(LayoutInflater.java:423) at android.view.LayoutInflater.inflate(LayoutInflater.java:374) at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469) at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) at com.ahsanwrites.travearner.MainActivity.onCreate(MainActivity.java:27) at android.app.Activity.performCreate(Activity.java:7023) at android.app.Activity.performCreate(Activity.java:7014) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1215) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2745) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2870) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1601) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:172) at android.app.ActivityThread.main(ActivityThread.java:6590) 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.UnsupportedOperationException: Failed to resolve attribute at index 13: TypedValue{t=0x2/d=0x7f0400b0 a=4} at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:944) at android.content.res.TypedArray.getDrawable(TypedArray.java:928) at android.view.View.<init>(View.java:4768) at android.view.ViewGroup.<init>(ViewGroup.java:597) at android.widget.FrameLayout.<init>(FrameLayout.java:92) at android.widget.FrameLayout.<init>(FrameLayout.java:87) at com.google.android.material.bottomnavigation.BottomNavigationView.<init>(BottomNavigationView.java:118) at com.tbuonomo.morphbottomnavigation.MorphBottomNavigationView.<init>(MorphBottomNavigationView.kt:79) at com.tbuonomo.morphbottomnavigation.MorphBottomNavigationView.<init>(MorphBottomNavigationView.kt:75)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:9

github_iconTop GitHub Comments

1reaction
VikashAnandJhacommented, Nov 22, 2021

Theme.MaterialComponents.Light.DarkActionBar

Its Working Thanks

1reaction
CamiloDelRealcommented, Aug 22, 2019

The error is in the use of MaterialComponents > 1.0.0 for creating MaterialShapeDrawable with a ShapePathModel In MaterialComponents > 1.0.0 MaterialShapeDrawable dont have a constructor for ShapePathModel see the changes in API at https://github.com/material-components/material-components-android/releases/tag/1.1.0-alpha01

for the moment, the best is downgrade MaterialComponents to 1.0.0 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error inflating class com.google.android.material ...
When I use com.google.android.material.bottomnavigation.BottomNavigationView in AndroidX it shows error on lollipop but I tried same code on ...
Read more >
Error inflating class. Fixed - YouTube
how to fix Error inflating class androidx.constraintlayout.widget.ConstraintLayout#ErrorInflatingClass #androidx.constraintlayout.widget.
Read more >
android.view.InflateException: Binary XML file line #2: Error ...
Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class unknowntag... error inflating class unknown ...
Read more >
Error inflating class androidx.appcompat.widget.Toolbar
in order to use a custom theme and a toolbar. But then I met the following exception: Android.Views.InflateException. Message=Binary XML file ...
Read more >
Error inflating class > com.google.android.material ...
switchmaterial.SwitchMaterial... And Firebase Crashlytics spams me with the following errors for many users. Fatal Exception: java.lang.RuntimeException Unable ...
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