Scrapped or attached views may not be recycled. isScrap:false isAttached:true
See original GitHub issueBug report
Summary
java.lang.IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false isAttached:true com.reactnative.community.viewpager2.widget.ViewPager2$RecyclerViewImpl{a137042 VFED..... ......ID 0,0-1080,1369 #1}, adapter:com.reactnativecommunity.viewpager.FragmentAdapter@b871853, layout:com.reactnative.community.viewpager2.widget.ViewPager2$LinearLayoutManagerImpl@520d590, context:com.facebook.react.uimanager.ThemedReactContext@7113f48
at androidx.recyclerview.widget.RecyclerView$Recycler.recycleViewHolderInternal(RecyclerView.java:6433)
at androidx.recyclerview.widget.RecyclerView.removeAnimatingView(RecyclerView.java:1456)
at androidx.recyclerview.widget.RecyclerView$ItemAnimatorRestoreListener.onAnimationFinished(RecyclerView.java:12699)
at androidx.recyclerview.widget.RecyclerView$ItemAnimator.dispatchAnimationFinished(RecyclerView.java:13199)
at androidx.recyclerview.widget.SimpleItemAnimator.dispatchRemoveFinished(SimpleItemAnimator.java:277)
at androidx.recyclerview.widget.DefaultItemAnimator$4.onAnimationEnd(DefaultItemAnimator.java:213)
at android.view.ViewPropertyAnimator$AnimatorEventListener.onAnimationEnd(ViewPropertyAnimator.java:1111)
at android.animation.Animator$AnimatorListener.onAnimationEnd(Animator.java:554)
at android.animation.ValueAnimator.endAnimation(ValueAnimator.java:1242)
at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1484)
at android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:146)
at android.animation.AnimationHandler.access$100(AnimationHandler.java:37)
at android.animation.AnimationHandler$1.doFrame(AnimationHandler.java:54)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:964)
at android.view.Choreographer.doCallbacks(Choreographer.java:790)
at android.view.Choreographer.doFrame(Choreographer.java:721)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:951)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Environment info
react-native info
output:
System:
OS: macOS 10.15.4
CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
Memory: 24.62 GB / 64.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 13.11.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.5 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.8.4 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK: Not Found
IDEs:
Android Studio: 3.6 AI-192.7142.36.36.6308749
Xcode: 11.4.1/11E503a - /usr/bin/xcodebuild
Languages:
Java: 13.0.1 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.0 => 16.13.0
react-native: ^0.62.2 => 0.62.2
npmGlobalPackages:
*react-native*: Not Found
Library version: x.x.x
Steps to reproduce
- Home -> OrganizationsList 2.Going back from OrganizationsList -> Home
export default createNativeStackNavigator(
{
Home: HomeScreen,
OrganizationsList: OrganizationsListScreen,
OrganizationDetail: OrganizationDetailScreen,
Rating: RatingScreen,
Feedbacks: FeedBacksScreen,
Provider: ProviderScreen,
WebBrowser: WebBrowserScreen,
SplashScreens: SplashScreens,
},
{
initialRouteName: 'Home',
headerMode: 'none',
},
);
Issue Analytics
- State:
- Created 3 years ago
- Reactions:16
- Comments:38 (10 by maintainers)
Top Results From Across the Web
RecyclerView crashes when "scrapped or attached views ...
This bug happens while recycling EditText s and one of them is focused. Naturally we tried clearing the focus when new data is...
Read more >Scrapped or attached views may not be recycled. isScrap ...
Bug report Summary java.lang.IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false isAttached:true ...
Read more >RecyclerView 报Scrapped or attached views may not be ...
IllegalArgumentException : Scrapped or attached views may not be recycled. isScrap:false isAttached:true at android.support.v7.widget.
Read more >RecyclerView crashes when “scrapped or attached views ...
IllegalArgumentException : Scrapped or attached views may not be recycled. isScrap:false isAttached:true at android.support.v7.widget.RecyclerView$Recycler.
Read more >v7/recyclerview/src/android/support/v7/widget ...
Scrap views may be reused without becoming fully detached ... "Scrapped or attached views may not be recycled. isScrap:". + holder.isScrap() + "...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Seems that the issue is still there when using v6.0.0-rc.0 with lazy page loading 😕
App crashes after navigating back or going forward from a screen with a
LazyPagerView
inside a native stack with the following log:I have same problem in react-navigation v5 (native-stack)