Crash with Gridlayout
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Domain
- mobile-dev
Research direction
Start with the stack trace at GridLayoutManager.java:1704, then trace the call path through SingleRow.java, Grid.java, and the Leanback fragment rendering flow. Reproduce the random crash while rendering or scrolling and establish a reliable trigger; done means the trigger no longer produces the null-state crash and the relevant behavior is covered by a regression check.
Written by the indexing model from the issue text.
Description
Hi All,
I am getting below crash randomly when we render the leanback fragment
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean androidx.recyclerview.widget.RecyclerView$State.isPreLayout()' on a null object reference
08-11 18:11:23.668 E/AndroidRuntime(16942): at androidx.leanback.widget.GridLayoutManager$2.addItem(GridLayoutManager.java:1704)
08-11 18:11:23.668 E/AndroidRuntime(16942): at androidx.leanback.widget.SingleRow.prependVisibleItems(SingleRow.java:93)
08-11 18:11:23.668 E/AndroidRuntime(16942): at androidx.leanback.widget.Grid.prependVisibleItems(Grid.java:371)
08-11 18:11:23.668 E/AndroidRuntime(16942): at androidx.leanback.widget.GridLayoutManager.prependVisibleItems(GridLayoutManager.java:1940)
08-11 18:11:23.668 E/AndroidRuntime(16942): at androidx.leanback.widget.GridLayoutManager.scrollDirectionPrimary(GridLayoutManager.java:2455)
08-11 18:11:23.668 E/AndroidRuntime(16942): at androidx.leanback.widget.GridLayoutManager.scrollVerticallyBy(GridLayoutManager.java:2406)
08-11 18:11:23.668 E/AndroidRuntime(16942): at androidx.recyclerview.widget.RecyclerView.scrollStep(RecyclerView.java:1972)
08-11 18:11:23.668 E/AndroidRuntime(16942): at androidx.recyclerview.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:5476)
08-11 18:11:23.668 E/AndroidRuntime(16942): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:781)
08-11 18:11:23.668 E/AndroidRuntime(16942): at android.view.Choreographer.doCallbacks(Choreographer.java:592)
08-11 18:11:23.668 E/AndroidRuntime(16942): at android.view.Choreographer.doFrame(Choreographer.java:559)
08-11 18:11:23.668 E/AndroidRuntime(16942): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:767)
08-11 18:11:23.668 E/AndroidRuntime(16942): at android.os.Handler.handleCallback(Handler.java:739)
08-11 18:11:23.668 E/AndroidRuntime(16942): at android.os.Handler.dispatchMessage(Handler.java:95)
08-11 18:11:23.668 E/AndroidRuntime(16942): at android.os.Looper.loop(Looper.java:135)
08-11 18:11:23.668 E/AndroidRuntime(16942): at android.app.ActivityThread.main(ActivityThread.java:5604)
08-11 18:11:23.668 E/AndroidRuntime(16942): at java.lang.reflect.Method.invoke(Native Method)
08-11 18:11:23.668 E/AndroidRuntime(16942): at java.lang.reflect.Method.invoke(Method.java:372)
08-11 18:11:23.668 E/AndroidRuntime(16942): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:984)
08-11 18:11:23.668 E/AndroidRuntime(16942): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
How to fix this
- Dominant language
- Kotlin
- Stars
- 1.3k
- Forks
- 400
- Avg merge
- 9d 10h
- Merged PRs (30d)
- 2
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from android/tv-samples
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
android/tv-samples#227 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
android/tv-samples#220 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 32/100
android/tv-samples#218 ·
-
Difficulty 5/5 Over a week Newbie friendliness 10/100
android/tv-samples#216 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
android/tv-samples#215 ·
All issues in android/tv-samples
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
MetrolistGroup/Metrolist#5426 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
🐛 Type:Bug 📥 State:Awaiting Assignment 🚨 Priority: P0 - Critical
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
micronizationlab/glafira-ai-hub#785 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sorsama/deepseek-harness-mobile#154 ·
Maintainers usually reply within 1 day
-
0. Needs triage enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day