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

GitHub | lijunguan | 7 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    ViewPage+Fragment列表中添加Header的情况下,重新切换回来的时候报错,The specified child already has a parent.

    GitHub | 7 months ago | lijunguan
    java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
  2. 0

    Error using the RecyclerView: The specified child already has a parent

    Stack Overflow | 2 years ago | zaingz
    java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
  3. 0

    Android ViewHolder parameter from RecyclerView#onCreateViewHolder differents

    Stack Overflow | 3 years ago | callofdutyops
    java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    RecyclerView crashing app (due to new design library?)

    Stack Overflow | 1 year ago | Roee
    java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
  6. 0

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

    Stack Overflow | 11 months ago | shagi
    java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. 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()
  2. Android Platform
    ViewGroup.addView
    1. android.view.ViewGroup.addViewInner(ViewGroup.java:4070)
    2. android.view.ViewGroup.addView(ViewGroup.java:3920)
    3. android.view.ViewGroup.addView(ViewGroup.java:3861)
    3 frames
  3. Android v7
    RecyclerView.onLayout
    1. android.support.v7.widget.RecyclerView$5.addView(RecyclerView.java:638)
    2. android.support.v7.widget.ChildHelper.addView(ChildHelper.java:107)
    3. android.support.v7.widget.RecyclerView$LayoutManager.addViewInt(RecyclerView.java:7054)
    4. android.support.v7.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:7012)
    5. android.support.v7.widget.RecyclerView$LayoutManager.addView(RecyclerView.java:7000)
    6. android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1428)
    7. android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1377)
    8. android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:578)
    9. android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3260)
    10. android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3069)
    11. android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3518)
    11 frames
  4. Android Platform
    ViewGroup.layout
    1. android.view.View.layout(View.java:16112)
    2. android.view.ViewGroup.layout(ViewGroup.java:5185)
    2 frames
  5. Android Support v4
    SwipeRefreshLayout.onLayout
    1. android.support.v4.widget.SwipeRefreshLayout.onLayout(SwipeRefreshLayout.java:598)
    1 frame
  6. Android Platform
    ViewGroup.layout
    1. android.view.View.layout(View.java:16112)
    2. android.view.ViewGroup.layout(ViewGroup.java:5185)
    2 frames
  7. Android Support v4
    ViewPager.onLayout
    1. android.support.v4.view.ViewPager.onLayout(ViewPager.java:1761)
    1 frame
  8. Android Platform
    ViewGroup.layout
    1. android.view.View.layout(View.java:16112)
    2. android.view.ViewGroup.layout(ViewGroup.java:5185)
    3. android.widget.LinearLayout.setChildFrame(LinearLayout.java:1959)
    4. android.widget.LinearLayout.layoutVertical(LinearLayout.java:1813)
    5. android.widget.LinearLayout.onLayout(LinearLayout.java:1722)
    6. android.view.View.layout(View.java:16112)
    7. android.view.ViewGroup.layout(ViewGroup.java:5185)
    8. android.widget.FrameLayout.layoutChildren(FrameLayout.java:639)
    9. android.widget.FrameLayout.onLayout(FrameLayout.java:574)
    10. android.view.View.layout(View.java:16112)
    11. android.view.ViewGroup.layout(ViewGroup.java:5185)
    11 frames
  9. android.support.design
    CoordinatorLayout.onLayout
    1. android.support.design.widget.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:131)
    2. android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:42)
    3. android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:1319)
    4. android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:817)
    4 frames
  10. Android Platform
    View.layout
    1. android.view.View.layout(View.java:16112)
    2. android.view.ViewGroup.layout(ViewGroup.java:5185)
    3. android.widget.FrameLayout.layoutChildren(FrameLayout.java:639)
    4. android.widget.FrameLayout.onLayout(FrameLayout.java:574)
    5. android.view.View.layout(View.java:16112)
    6. android.view.ViewGroup.layout(ViewGroup.java:5185)
    7. android.widget.LinearLayout.setChildFrame(LinearLayout.java:1959)
    8. android.widget.LinearLayout.layoutVertical(LinearLayout.java:1813)
    9. android.widget.LinearLayout.onLayout(LinearLayout.java:1722)
    10. android.view.View.layout(View.java:16112)
    11. android.view.ViewGroup.layout(ViewGroup.java:5185)
    12. android.widget.FrameLayout.layoutChildren(FrameLayout.java:639)
    13. android.widget.FrameLayout.onLayout(FrameLayout.java:574)
    14. android.view.View.layout(View.java:16112)
    15. android.view.ViewGroup.layout(ViewGroup.java:5185)
    16. android.widget.LinearLayout.setChildFrame(LinearLayout.java:1959)
    17. android.widget.LinearLayout.layoutVertical(LinearLayout.java:1813)
    18. android.widget.LinearLayout.onLayout(LinearLayout.java:1722)
    19. android.view.View.layout(View.java:16112)
    20. android.view.ViewGroup.layout(ViewGroup.java:5185)
    21. android.widget.FrameLayout.layoutChildren(FrameLayout.java:639)
    22. android.widget.FrameLayout.onLayout(FrameLayout.java:574)
    23. android.view.View.layout(View.java:16112)
    23 frames