Skip to content

[newArch] Crash when going back from a view that has PagerView #942

Closed
@TomCorvus

Description

@TomCorvus

Environment

Only on Android.

    "react-native": "0.76.3",
    "react-native-pager-view": "^6.6.0",

Description

Hello,

When I go back from a view that has PagerView, the application crashes.
It appears with react-native new architecture, I don't reproduce this problem when new arch is not activated.

This problem has appeared since the 6.6.0 version.

Reproducible Demo

https://github.com/TomCorvus/RNavigation

Fatal Exception: java.lang.IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false isAttached:true androidx.viewpager2.widget.f$m{306a6fa VFED..... ......ID 0,0-1080,1766 #6}, adapter:com.reactnativepagerview.i@4e728ec, layout:androidx.viewpager2.widget.f$h@2adbdbc, context:com.facebook.react.uimanager.C0@e204f60
       at androidx.recyclerview.widget.RecyclerView$Recycler.recycleViewHolderInternal(RecyclerView.java:7071)
       at androidx.recyclerview.widget.RecyclerView.removeAnimatingView(RecyclerView.java:1597)
       at androidx.recyclerview.widget.RecyclerView$ItemAnimatorRestoreListener.onAnimationFinished(RecyclerView.java:13655)
       at androidx.recyclerview.widget.RecyclerView$ItemAnimator.dispatchAnimationFinished(RecyclerView.java:14157)
       at androidx.recyclerview.widget.SimpleItemAnimator.dispatchRemoveFinished(SimpleItemAnimator.java:286)
       at androidx.recyclerview.widget.DefaultItemAnimator$4.onAnimationEnd(DefaultItemAnimator.java:216)
       at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationEnd(ViewPropertyAnimator.java:1112)

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions