Fixed
Status Update
Comments
ra...@squareup.com <ra...@squareup.com> #2
Still broken in v22.1.1
ra...@squareup.com <ra...@squareup.com> #3
Interesting note on this one: you can change the behavior by changing the font size in the row layout. If you make them bigger or smaller you change many updates it takes to cause a crash, or prevent a crash from ever(?) happening.
al...@android.com <al...@android.com>
ra...@squareup.com <ra...@squareup.com> #4
Any news on this one? Notice that the sample here does not repeat the mistake of the one in issue 36949180 . We're always inflating a new view when we're supposed to.
yb...@google.com <yb...@google.com> #5
can you attach the app ? (cannot see it)
ra...@squareup.com <ra...@squareup.com> #6
Weird, I word have sworn I attached it. Here you go.
yb...@google.com <yb...@google.com> #7
Thanks, I can reproduce the error though a lot going on in this code so cannot easily say if something is wrong in RV or the test code. Working on it.
yb...@google.com <yb...@google.com> #8
hmm, for some reason the same view holder comes back from the recycler twice, w/o being recycled.
Debugging further, just wanted to give a quick update.
See 39c668e0 below which comes back recycler again in post layout step but has scrap flag turned on.
et view for pos 4
from recycler ViewHolder{39c668e0 position=-1 id=-1, oldPos=-1, pLpos:-1 unbound no parent}
get view for pos 5
from recycler ViewHolder{127e51ff position=-1 id=-1, oldPos=-1, pLpos:-1 unbound no parent}
get view for pos 6
from recycler ViewHolder{1ff21d90 position=-1 id=-1, oldPos=-1, pLpos:-1 unbound no parent}
get view for pos 0
from recycler ViewHolder{3140c476 position=-1 id=-1, oldPos=-1, pLpos:-1 unbound no parent}
get view for pos 1
from recycler ViewHolder{39c668e0 position=5 id=-1, oldPos=-1, pLpos:-1 scrap tmpDetached no parent}
Debugging further, just wanted to give a quick update.
See 39c668e0 below which comes back recycler again in post layout step but has scrap flag turned on.
et view for pos 4
from recycler ViewHolder{39c668e0 position=-1 id=-1, oldPos=-1, pLpos:-1 unbound no parent}
get view for pos 5
from recycler ViewHolder{127e51ff position=-1 id=-1, oldPos=-1, pLpos:-1 unbound no parent}
get view for pos 6
from recycler ViewHolder{1ff21d90 position=-1 id=-1, oldPos=-1, pLpos:-1 unbound no parent}
get view for pos 0
from recycler ViewHolder{3140c476 position=-1 id=-1, oldPos=-1, pLpos:-1 unbound no parent}
get view for pos 1
from recycler ViewHolder{39c668e0 position=5 id=-1, oldPos=-1, pLpos:-1 scrap tmpDetached no parent}
yb...@google.com <yb...@google.com> #9
Hi,
Looks like a cached view is being passed to the item animator which in return causes it to be recycled twice. I'm still working on it to create a test case but so far, looks like a RecyclerView bug.
I'll keep updating as i find out more.
Thanks.
Looks like a cached view is being passed to the item animator which in return causes it to be recycled twice. I'm still working on it to create a test case but so far, looks like a RecyclerView bug.
I'll keep updating as i find out more.
Thanks.
ra...@squareup.com <ra...@squareup.com> #10
Thanks!
yb...@google.com <yb...@google.com> #11
Ok, so here is what was happening:
There was two problems. The first one is that we were not removing updated views from cache, which was waste of that space (because they need to be rebound anyways). It was also surfacing the bug so it had a positive impact.
The actual problem was that when we recycle scrap views, we were not ending their animations. When animation ends, it would recycle it again causing the view to show up in recycle pool twice.
Thanks a lot for the detailed bug report.
There was two problems. The first one is that we were not removing updated views from cache, which was waste of that space (because they need to be rebound anyways). It was also surfacing the bug so it had a positive impact.
The actual problem was that when we recycle scrap views, we were not ending their animations. When animation ends, it would recycle it again causing the view to show up in recycle pool twice.
Thanks a lot for the detailed bug report.
ra...@squareup.com <ra...@squareup.com> #12
Great! Thanks for digging into it.
[Deleted User] <[Deleted User]> #13
I know it's marked as `FutureRelease` but that's crashing my users now.
Is there any workaround I can do to avoid it?
Is there any workaround I can do to avoid it?
ra...@squareup.com <ra...@squareup.com> #14
I don't know of any way to avoid this other than downgrading to com.android.support:recyclerview-v7:21.0.3
lo...@gmail.com <lo...@gmail.com> #15
I had this issue too.
#11 was spot on. Ensure your animations have completely finished before being scrapped to avoid this,
#11 was spot on. Ensure your animations have completely finished before being scrapped to avoid this,
ko...@gmail.com <ko...@gmail.com> #16
Hi guys!
Is there any news about issue?
Is there any news about issue?
gi...@gmail.com <gi...@gmail.com> #17
As #11 says, we can turn off the default animation for recyclerview. If there are any other ways, please let us know. thx.
ma...@gmail.com <ma...@gmail.com> #18
mark
fa...@gmail.com <fa...@gmail.com> #19
Still broken in v25.3.1
ya...@gmail.com <ya...@gmail.com> #20
still broken in v27
Description
Is this a coincidence? private static final int DEFAULT_MAX_SCRAP = 5;
Perhaps related to
```
java.lang.IllegalArgumentException: Called attach on a child which is not detached: ViewHolder{32b0db67 position=2 id=-1, oldPos=-1, pLpos:-1undefined adapter position no parent}
at android.support.v7.widget.RecyclerView$4.attachViewToParent(RecyclerView.java:422)
at android.support.v7.widget.ChildHelper.attachViewToParent(ChildHelper.java:208)
at android.support.v7.widget.RecyclerView$LayoutManager.addViewInt(RecyclerView.java:5239)
at android.support.v7.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:5216)
at android.support.v7.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:5204)
at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1325)
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1274)
at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:525)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2118)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:2415)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1076)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at com.android.internal.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:494)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:579)
at android.widget.FrameLayout.onLayout(FrameLayout.java:514)
at android.view.View.layout(View.java:15671)
at android.view.ViewGroup.layout(ViewGroup.java:5038)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2086)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1843)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1061)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5885)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
at android.view.Choreographer.doCallbacks(Choreographer.java:580)
at android.view.Choreographer.doFrame(Choreographer.java:550)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
```