material-components / material-components/material-components-android
[AppBarLayout] HeaderScrollingViewBehavior issue
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
here's the crash log i received on crashlytics
`Fatal Exception: java.lang.NullPointerException: Attempt to write to field 'boolean android.animation.AnimatorSet$Node.mEnded' on a null object reference
at android.animation.AnimatorSet.onChildAnimatorEnded(AnimatorSet.java:799)
at android.animation.AnimatorSet.start(AnimatorSet.java:640)
at android.animation.StateListAnimator.start(StateListAnimator.java:188)
at android.animation.StateListAnimator.setState(StateListAnimator.java:181)
at android.view.View.drawableStateChanged(View.java:18049)
at android.view.ViewGroup.drawableStateChanged(ViewGroup.java:6479)
at android.view.View.refreshDrawableState(View.java:18108)
at android.view.View.dispatchAttachedToWindow(View.java:15589)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2955)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2962)
at android.view.ViewGroup.addViewInner(ViewGroup.java:4510)
at android.view.ViewGroup.addView(ViewGroup.java:4312)
at android.view.ViewGroup.addView(ViewGroup.java:4252)
at android.view.ViewGroup.addView(ViewGroup.java:4225)
at androidx.viewpager2.adapter.FragmentStateAdapter.addViewToContainer(FragmentStateAdapter.java:406)
at androidx.viewpager2.adapter.FragmentStateAdapter.placeFragmentInViewHolder(FragmentStateAdapter.java:328)
at androidx.viewpager2.adapter.FragmentStateAdapter.onViewAttachedToWindow(FragmentStateAdapter.java:273)
at androidx.viewpager2.adapter.FragmentStateAdapter.onViewAttachedToWindow(FragmentStateAdapter.java:73)
at androidx.recyclerview.widget.RecyclerView.dispatchChildAttached(RecyclerView.java:8377)
at androidx.recyclerview.widget.RecyclerView$5.addView(RecyclerView.java:954)
at androidx.recyclerview.widget.ChildHelper.addView(ChildHelper.java:131)
at androidx.recyclerview.widget.RecyclerView$LayoutManager.addViewInt(RecyclerView.java:9430)
at androidx.recyclerview.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:9388)
at androidx.recyclerview.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:9375)
at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1676)
at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1622)
at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:687)
at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4645)
at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:4348)
at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4919)
at android.view.View.layout(View.java:17702)
at android.view.ViewGroup.layout(ViewGroup.java:5631)
at androidx.viewpager2.widget.ViewPager2.onLayout(ViewPager2.java:535)
at android.view.View.layout(View.java:17702)
at android.view.ViewGroup.layout(ViewGroup.java:5631)
at com.google.android.material.appbar.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:149)
at com.google.android.material.appbar.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:43)
at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:953)
at android.view.View.layout(View.java:17702)
at android.view.ViewGroup.layout(ViewGroup.java:5631)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:325)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:17702)
at android.view.ViewGroup.layout(ViewGroup.java:5631)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1762)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1606)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1515)
at android.view.View.layout(View.java:17702)
at android.view.ViewGroup.layout(ViewGroup.java:5631)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:325)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:17702)
at android.view.ViewGroup.layout(ViewGroup.java:5631)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1762)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1606)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1515)
at android.view.View.layout(View.java:17702)
at android.view.ViewGroup.layout(ViewGroup.java:5631)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:325)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at com.android.internal.policy.DecorView.onLayout(DecorView.java:774)
at android.view.View.layout(View.java:17702)
at android.view.ViewGroup.layout(ViewGroup.java:5631)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2519)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2234)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1372)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6774)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:926)
at android.view.Choreographer.doCallbacks(Choreographer.java:735)
at android.view.Choreographer.doFrame(Choreographer.java:667)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:912)
at android.os.Handler.handleCallback(Handler.java:761)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6517)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)`
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the reported stack from HeaderScrollingViewBehavior.layoutChild through ViewPager2 and FragmentStateAdapter attachment into Android's AnimatorSet. Reproduce the crash if possible and determine the relevant Material Components behavior; done means the crash is prevented and the scenario has regression coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100