aurelhubert / ahbottomnavigation

A library to reproduce the behavior of the Bottom Navigation guidelines from Material Design.
3.84k stars 683 forks source link

Not compatible with the latest support library 28.0.0? #396

Closed MenuHunt closed 6 years ago

MenuHunt commented 6 years ago

I updated my support library to 28.0.0. I used your example code with & without menu resource. I always get the exception as shown below. I wonder if ahbottomnavigation is not compatible with the latest support library version 28.0.0. I also used Kotlin. Thanks

2018-11-30 10:22:55.743 7085-7085/com.xxxxxx.xxxxxx E/AndroidRuntime: FATAL EXCEPTION: main Process: xxxxxxxxxxx, PID: 7085 java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.drawable.Drawable.clearColorFilter()' on a null object reference at com.aurelhubert.ahbottomnavigation.AHHelper.getTintDrawable(AHHelper.java:37) at com.aurelhubert.ahbottomnavigation.AHBottomNavigation.createClassicItems(AHBottomNavigation.java:471) at com.aurelhubert.ahbottomnavigation.AHBottomNavigation.createItems(AHBottomNavigation.java:286) at com.aurelhubert.ahbottomnavigation.AHBottomNavigation.onSizeChanged(AHBottomNavigation.java:150) at android.view.View.sizeChange(View.java:19792) at android.view.View.setFrame(View.java:19753) at android.view.View.layout(View.java:19656) at android.view.ViewGroup.layout(ViewGroup.java:6075) at android.support.constraint.ConstraintLayout.onLayout(ConstraintLayout.java:1960) at android.view.View.layout(View.java:19659) at android.view.ViewGroup.layout(ViewGroup.java:6075) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:19659) at android.view.ViewGroup.layout(ViewGroup.java:6075) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635) at android.widget.LinearLayout.onLayout(LinearLayout.java:1544) at android.view.View.layout(View.java:19659) at android.view.ViewGroup.layout(ViewGroup.java:6075) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:19659) at android.view.ViewGroup.layout(ViewGroup.java:6075) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1791) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1635) at android.widget.LinearLayout.onLayout(LinearLayout.java:1544) at android.view.View.layout(View.java:19659) at android.view.ViewGroup.layout(ViewGroup.java:6075) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at com.android.internal.policy.DecorView.onLayout(DecorView.java:761) at android.view.View.layout(View.java:19659) at android.view.ViewGroup.layout(ViewGroup.java:6075) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2496) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2212) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1392) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6752) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911) at android.view.Choreographer.doCallbacks(Choreographer.java:723) at android.view.Choreographer.doFrame(Choreographer.java:658) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897) at android.os.Handler.handleCallback(Handler.java:790) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) 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)

MenuHunt commented 6 years ago

It was caused by the sizes of the icons I used. After I used the built-in image set generation for icons of different sizes for Android, that error is gone. Thanks