java.lang.IllegalStateException: Added View has RecyclerView as parent but view is not a real child. Unfiltered index:5

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
Expert tip

This is a bug in UltimateRecyclerView. One workaround is disabling the swipe gesture when the recyclerview is refreshing. Another workaround seems to be not specifying your own ids

,

You should use View v = inflater.inflate(R.layout.your_layout, parent, false);

instead of View v = inflater.inflate(R.layout.your_layout, parent, true);

Solutions on the web

via GitHub by muhezi
, 1 year ago
Added View has RecyclerView as parent but view is not a real child. Unfiltered index:5
via GitHub by yuruxuan
, 1 year ago
Added View has RecyclerView as parent but view is not a real child. Unfiltered index:0
via GitHub by captain-miao
, 1 year ago
Added View has RecyclerView as parent but view is not a real child. Unfiltered index:0
via GitHub by caoeryang
, 9 months ago
Added View has RecyclerView as parent but view is not a real child. Unfiltered index:0
via GitHub by wyy283
, 1 year ago
Added View has RecyclerView as parent but view is not a real child. Unfiltered index:1
via GitHub by woniu0936
, 1 year ago
Added View has RecyclerView as parent but view is not a real child. Unfiltered index:3
java.lang.IllegalStateException: Added View has RecyclerView as parent but view is not a real child. Unfiltered index:5
at android.support.v7.widget.RecyclerView$LayoutManager.addViewInt(RecyclerView.java:6720)
at android.support.v7.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:6686)
at android.support.v7.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:6674)
at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1404)
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1353)
at android.support.v7.widget.LinearLayoutManager.scrollBy(LinearLayoutManager.java:1180)
at android.support.v7.widget.LinearLayoutManager.scrollVerticallyBy(LinearLayoutManager.java:1031)
at android.support.v7.widget.RecyclerView.scrollByInternal(RecyclerView.java:1529)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
2 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago

Know the solutions? Share your knowledge to help other developers to debug faster.