Droppers/AnimatedBottomBar

android.view.InflateException

Closed this issue · 2 comments

My app is crashing when i applied this library, i tried to create a new project following the readME.md settings but keeps showing me this error:

2020-06-08 06:39:44.178 9236-9236/com.example.myapplication E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.myapplication, PID: 9236
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapplication/com.example.myapplication.MainActivity}: android.view.InflateException: Binary XML file line #9: Binary XML file line #9: Error inflating class nl.joery.animatedbottombar.AnimatedBottomBar
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2895)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1616)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6651)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
Caused by: android.view.InflateException: Binary XML file line #9: Binary XML file line #9: Error inflating class nl.joery.animatedbottombar.AnimatedBottomBar
Caused by: android.view.InflateException: Binary XML file line #9: Error inflating class nl.joery.animatedbottombar.AnimatedBottomBar
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:651)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:794)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:734)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:867)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
at android.view.LayoutInflater.inflate(LayoutInflater.java:519)
at android.view.LayoutInflater.inflate(LayoutInflater.java:427)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
at com.example.myapplication.MainActivity.onCreate(MainActivity.java:12)
at android.app.Activity.performCreate(Activity.java:7088)
at android.app.Activity.performCreate(Activity.java:7079)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1215)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2895)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1616)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6651)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
Caused by: java.lang.Exception: Menu item attribute 'icon' for tab named 'Home' is missing
at nl.joery.animatedbottombar.MenuParser.parse(MenuParser.kt:22)
at nl.joery.animatedbottombar.AnimatedBottomBar.initInitialTabs(AnimatedBottomBar.kt:240)
at nl.joery.animatedbottombar.AnimatedBottomBar.initAttributes(AnimatedBottomBar.kt:190)
at nl.joery.animatedbottombar.AnimatedBottomBar.(AnimatedBottomBar.kt:50)
at nl.joery.animatedbottombar.AnimatedBottomBar.(AnimatedBottomBar.kt:27)
at nl.joery.animatedbottombar.AnimatedBottomBar.(Unknown Source:6)
at java.lang.reflect.Constructor.newInstance0(Native Method)聽
at java.lang.reflect.Constructor.newInstance(Constructor.java:334)聽
at android.view.LayoutInflater.createView(LayoutInflater.java:651)聽
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:794)聽
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:734)聽
at android.view.LayoutInflater.rInflate(LayoutInflater.java:867)聽
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)聽
at android.view.LayoutInflater.inflate(LayoutInflater.java:519)聽
at android.view.LayoutInflater.inflate(LayoutInflater.java:427)聽
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)聽
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)聽
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)聽
at com.example.myapplication.MainActivity.onCreate(MainActivity.java:12)聽
at android.app.Activity.performCreate(Activity.java:7088)聽
at android.app.Activity.performCreate(Activity.java:7079)聽
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1215)聽
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)聽
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2895)聽
at android.app.ActivityThread.-wrap11(Unknown Source:0)聽
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1616)聽
at android.os.Handler.dispatchMessage(Handler.java:106)聽
at android.os.Looper.loop(Looper.java:176)聽
at android.app.ActivityThread.main(ActivityThread.java:6651)聽
at java.lang.reflect.Method.invoke(Native Method)聽
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)聽
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)聽

The icon attribute appears to be missing.
Caused by: java.lang.Exception: Menu item attribute 'icon' for tab named 'Home' is missing

Please verify your menu item is defined as following: (android:icon="@drawable/home")

<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:id="@+id/tab_home"
        android:icon="@drawable/home"
        android:title="@string/home" />
    ...
</menu>

Thank you