Scrapped or attached views may not be recycled. isScrap:false isAttached:true

Samebug tips2

This happens when you have android:animateLayoutChanges set to true in your XML file and you call notifyDataSetChanged(). To fix it, you have to set android:animateLayoutChanges to false.


In your xml just avoid using android:animateLayoutChanges with RecyclerViews.and also if you have set android:focusableInTouchMode="true" in your RecycleView you have to set false.

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web39

  • via Stack Overflow by Ivan Samsonov
  • via GitHub by jjhesk
  • Stack trace

    • java.lang.IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false isAttached:true at$Recycler.recycleViewHolderInternal( at at$6400( at$ItemAnimatorRestoreListener.onAnimationFinished( at$ItemAnimator.dispatchAnimationFinished( at at$7.onAnimationEnd( at$1.onAnimationEnd( at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationEnd( at android.animation.ValueAnimator.endAnimation( at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame( at android.animation.ValueAnimator$AnimationHandler$ at android.view.Choreographer$ at android.view.Choreographer.doCallbacks( at android.view.Choreographer.doFrame( at android.view.Choreographer$ at android.os.Handler.handleCallback( at android.os.Handler.dispatchMessage( at android.os.Looper.loop( at at java.lang.reflect.Method.invoke(Native Method) at$ at

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Hiren AmaliyarHiren Amaliyar
    8 times, last one
    12 times, last one
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    6 more bugmates