Status Update
Comments
an...@disney.com <an...@disney.com> #2
We are seeing crash #2 as well in our Android TV and Fire TV applications. We are using the androidx.leanback:leanback:1.0.0
version.
p4...@gmail.com <p4...@gmail.com> #3
it happens random and we can't reproduce crash and it also happen with particular device with android 9
Could anyone help?
nc...@gmail.com <nc...@gmail.com> #4
ja...@google.com <ja...@google.com> #5
ja...@google.com <ja...@google.com> #6
I looked at Pitot and can't find these errors. In fact errors reported for leanback apps seem to be pretty low.
da...@google.com <da...@google.com> #7
It will be helpful if you can find a reliable way to reproduce and paste a sample app with source code.
da...@google.com <da...@google.com> #8
It can runs into error like this, which is very hard to debug.
an...@disney.com <an...@disney.com> #9
We have never been able to pin down reproducible steps to get the application to crash, but I can tell you that all of the changes made to the adapter are done on the UI thread. Our app has a Fragment
that extends the BrowseSupportFragment
class that uses LiveData
via a ViewModel
to update the UI. The app does the following once it receives that data:
- It first checks to see if the updated data contains the same number of rows that the base adapter contains
- If the number of rows are the same, it then iterates over each row and, using a
DiffCallback
, updates each row's adapter - If the number of rows are different, it clears the base adapter and simply adds all of the new data to that base adapter
Most of the time, we notice that this crash occurs after the user has navigated back to this Fragment
after navigating away for a long period of time. So for example, a user selects an item on the Fragment
and that starts up a new Activity
that plays video for an hour or so, then navigates back to Fragment
.
[Deleted User] <[Deleted User]> #10
ja...@google.com <ja...@google.com>
jo...@alticelabs.com <jo...@alticelabs.com> #11
Any clues on this? Can we help in anyway? This is the top crash on our app.
nc...@gmail.com <nc...@gmail.com> #12
ma...@redge.com <ma...@redge.com> #13
da...@google.com <da...@google.com> #14
pl...@google.com <pl...@google.com> #15
As the team has so far been unable to reproduce the issue, if you are able to reproduce the issue in a minimal reproducible example, please share with us:
- The minimal code for reproducing the issue, and
- Detailed steps to reproduce.
ru...@joyn.de <ru...@joyn.de> #16
We were using a combination of `notifyDataSetChanged` and `notifyItemRangeRemoved` in the same frame, which seemed to cause this issue during fast scrolling events.
I was trying to create a sample app to reproduce this problem, but that didn't lead anywhere. Never got the crash there.
To anyone having this issue, please double check your adapter notify calls and make sure you test fast scroll scenarios.
pl...@google.com <pl...@google.com> #17
Thanks for the insights and clarification!
ru...@gmail.com <ru...@gmail.com> #18
di...@gmail.com <di...@gmail.com> #19
di...@gmail.com <di...@gmail.com> #20
I can confirm that after
replacing
androidx.leanback:leanback:1.1.0-rc02
with
androidx.leanback:leanback:1.2.0-alpha02
issue disappeared, at least in our app.
di...@gmail.com <di...@gmail.com> #21
Please ignore above, #20
.
After some testing, we are still able to reproduce it.
I think the problem is specifically in calling notifyDataSetChanged()
rapidly (3-4 times) with a fairly complex rendering, while something else is ON at the main thread, e.g. fast scrolling backwards the list (press and hold DPad UP button) right when these calls are just happening.
We've fixed the issue by:
- removing
notifyDataSetChanged()
at any places where it is not needed - replacing any left
notifyDataSetChanged()
withnotifyItemRangeChanged(0, itemCount)
eu...@gmail.com <eu...@gmail.com> #22
eu...@gmail.com <eu...@gmail.com> #23
An example:
0 1 2 -> not visible in the top direction
3 4 5 -> currently visible on the screen
6 7 8 -> not visible to the bottom direction.
on focusing item #8 - data requested.
Attempt to navigate to item #0 before data is received.
During the attempt, data was received and `animateMove`/`animateAdd` has been called which lead to the crash.
`setItemAnimator(null)` OR overriding `DefaultItemAnimator` with disabled ability to animate during scrolling helped in my case.
ru...@gmail.com <ru...@gmail.com> #24
Disabling animations isn't really a fix. For anyone still interested, please check this:
ka...@gmail.com <ka...@gmail.com> #25
FATAL EXCEPTION: main
Process: com.abpnewslive, PID: 2483
java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.recyclerview.widget.RecyclerView.defaultOnMeasure(int, int)' on a null object reference
at androidx.recyclerview.widget.RecyclerView$LayoutManager.onMeasure(Unknown Source:2)
at androidx.recyclerview.widget.RecyclerView.onMeasure(Unknown Source:30)
at android.view.View.measure(View.java:25466)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
at android.view.View.measure(View.java:25466)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
at android.view.View.measure(View.java:25466)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:735)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:481)
at android.view.View.measure(View.java:25466)
at androidx.core.widget.NestedScrollView.measureChildWithMargins(Unknown Source:38)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at androidx.core.widget.NestedScrollView.onMeasure(Unknown Source:0)
at android.view.View.measure(View.java:25466)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:25466)
at androidx.constraintlayout.widget.ConstraintLayout$Measurer.measure(Unknown Source:539)
at androidx.constraintlayout.solver.widgets.ConstraintWidgetContainer.measure(Unknown Source:271)
at androidx.constraintlayout.solver.widgets.ConstraintWidgetContainer.layout(Unknown Source:137)
at androidx.constraintlayout.solver.widgets.analyzer.BasicMeasure.solveLinearSystem(Unknown Source:29)
at androidx.constraintlayout.solver.widgets.analyzer.BasicMeasure.solverMeasure(Unknown Source:294)
at androidx.constraintlayout.solver.widgets.ConstraintWidgetContainer.measure(Unknown Source:23)
at androidx.constraintlayout.widget.ConstraintLayout.h(:2)
at androidx.constraintlayout.widget.ConstraintLayout.onMeasure(Unknown Source:149)
at android.view.View.measure(View.java:25466)
at androidx.slidingpanelayout.widget.SlidingPaneLayout.onMeasure(Unknown Source:237)
at android.view.View.measure(View.java:25466)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at android.view.View.measure(View.java:25466)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1552)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:842)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:721)
at android.view.View.measure(View.java:25466)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6957)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
at com.android.internal.policy.DecorView.onMeasure(DecorView.java:747)
at android.view.View.measure(View.java:25466)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:3397)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:2228)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2486)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1952)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8184)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:972)
at android.view.Choreographer.doCallbacks(Choreographer.java:796)
at android.view.Choreographer.doFrame(Choreographer.java:731)
2023-04-12 06:34:17.945 2483-2483 AndroidRuntime com.abpnewslive E at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
da...@google.com <da...@google.com> #28
the fix is in recyclerview, which hasn't released yet.
Please refer to
ru...@joyn.de <ru...@joyn.de> #29
When can we expect a new leanback release with this fix?
Description
Component used: androidx.leanback:leanback Version used: 1.1.0-beta01 Devices/Android versions reproduced on: Multiple Devices with at least AndroidTv version 9 and 10. (Our app only supports this two versions)
Got at least 2 similar NullPointerException crashes registered on crashlytics, that seem to be originated on the lenaback GridlayoutManager getEdge function not checking for null values.
I haven't found an consistent way to replicate the crash, but it seems to happen when scrolling through the lists.
I leave here part of the stack trace registered on crashlytics:
Crash #1: