java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.

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

Solutions on the web

via GitHub by lijunguan
, 1 year ago
The specified child already has a parent. You must call removeView() on the child's parent first.
via Stack Overflow by Zelmec
, 5 months ago
The specified child already has a parent. You must call removeView() on the child's parent first. So my question is: What am I doing wrong? Am I using data binding incorrectly? Is Kotlin just not playing well with data binding? Any help or feedback
via Stack Overflow by user8109379
, 4 months ago
The specified child already has a parent. You must call removeView() on the child's parent first.
via Stack Overflow by Gurjeet Singh
, 8 months ago
The specified child already has a parent. You must call removeView() on the child's parent first.
via Stack Overflow by Roee
, 1 year ago
The specified child already has a parent. You must call removeView() on the child's parent first.
via Stack Overflow by Dockson
, 11 months ago
The specified child already has a parent. You must call removeView() on the child's parent first.
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
at android.view.ViewGroup.addViewInner(ViewGroup.java:4070)
at android.view.ViewGroup.addView(ViewGroup.java:3920)
at android.view.ViewGroup.addView(ViewGroup.java:3861)
at android.support.v7.widget.RecyclerView$5.addView(RecyclerView.java:638)
at android.support.v7.widget.ChildHelper.addView(ChildHelper.java:107)
at android.support.v7.widget.RecyclerView$LayoutManager.addViewInt(RecyclerView.java:7054)
at android.support.v7.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:7012)
at android.support.v7.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:7000)
at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1428)
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1377)
at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:578)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3260)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3069)
at android.view.View.layout(View.java:16112)
at android.view.ViewGroup.layout(ViewGroup.java:5185)
at android.view.View.layout(View.java:16112)
at android.view.ViewGroup.layout(ViewGroup.java:5185)
at android.view.View.layout(View.java:16112)
at android.view.ViewGroup.layout(ViewGroup.java:5185)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1959)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1813)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1722)
at android.view.View.layout(View.java:16112)
at android.view.ViewGroup.layout(ViewGroup.java:5185)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:639)
at android.widget.FrameLayout.onLayout(FrameLayout.java:574)
at android.view.View.layout(View.java:16112)
at android.view.ViewGroup.layout(ViewGroup.java:5185)
at android.support.design.widget.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:131)
at android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:42)
at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:1319)
at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:817)
at android.view.View.layout(View.java:16112)
at android.view.ViewGroup.layout(ViewGroup.java:5185)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:639)
at android.widget.FrameLayout.onLayout(FrameLayout.java:574)
at android.view.View.layout(View.java:16112)
at android.view.ViewGroup.layout(ViewGroup.java:5185)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1959)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1813)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1722)
at android.view.View.layout(View.java:16112)
at android.view.ViewGroup.layout(ViewGroup.java:5185)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:639)
at android.widget.FrameLayout.onLayout(FrameLayout.java:574)
at android.view.View.layout(View.java:16112)
at android.view.ViewGroup.layout(ViewGroup.java:5185)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1959)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1813)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1722)
at android.view.View.layout(View.java:16112)
at android.view.ViewGroup.layout(ViewGroup.java:5185)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:639)
at android.widget.FrameLayout.onLayout(FrameLayout.java:574)
at android.view.View.layout(View.java:16112)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
2 times, 10 months ago
6 times, 11 months ago
5 times, 1 year ago
18 more bugmates

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