[2.3][Android] Layout animation on screen transition freezes gesture responder
See original GitHub issueDescription
Currently, when displaying an element with layout animation while navigating back or forth, it freezes the gesture responder. Nothing on screen reacts to touches or gestures.
react-native-gesture-handler’s elements do respond to touches and gestures, but default ones from React-Native do not, my guess is - it somehow breaks the default gesture handler.
Works good on iOS.
Expected behavior
Layout animations should not break the gesture responder system.
Actual behavior & steps to reproduce
- Launch the app from completely killed state (this is hard to reproduce on an app which was soft-killed)
- Navigate to different screen.
- Click on a button which navigates back and shows an element with layout animations.
- Loose control on all of the touchables.
Snack or minimal code example
We’ve created this scruffy reproducible demo, it’s under 100 lines of code in App.js, created with react-native init
Package versions
- React Native: 0.66.4
- React Native Reanimated: 2.3.1
- NodeJS: 16.13
- Xcode: -
- Java & Gradle: 15.0.2 & 6.9
- React Navigation: 5 / 6
Affected platforms
- Android
- iOS
- Web
Coupe of logs on Logcat
It usually ends up in a Davey and GC kicks in, plus sometimes Choreographer skips some frames. Here are the logs:
Log 1
2021-12-21 18:32:21.232 2745-2764/com.company.app I/company.app: Background young concurrent copying GC freed 225399(7542KB) AllocSpace objects, 12(240KB) LOS objects, 25% free, 20MB/26MB, paused 300us total 154.029ms
2021-12-21 18:32:22.165 2745-2745/com.company.app W/Looper: Slow Looper main: Long Msg: seq=16808 plan=18:32:21.159 late=0ms wall=1006ms running=0ms h=android.view.Choreographer$FrameHandler c=android.view.Choreographer$FrameDisplayEventReceiver
2021-12-21 18:32:22.165 2745-2745/com.company.app I/Choreographer: Skipped 59 frames! The application may be doing too much work on its main thread.
2021-12-21 18:32:22.167 2745-2745/com.company.app W/Looper: Slow Looper main: doFrame is 991ms late because of 1 msg, msg 1 took 1006ms (seq=16808 h=android.view.Choreographer$FrameHandler c=android.view.Choreographer$FrameDisplayEventReceiver)
2021-12-21 18:32:22.191 2745-2909/com.company.app I/OpenGLRenderer: Davey! duration=1032ms; Flags=0, IntendedVsync=4897431297563, Vsync=4897431297563, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=4897431882522, AnimationStart=4897431885829, PerformTraversalsStart=4898407919676, DrawStart=4898408303368, SyncQueued=4898429983676, SyncStart=4898430946753, IssueDrawCommandsStart=4898437485291, SwapBuffers=4898461448983, FrameCompleted=4898464385830, DequeueBufferDuration=476000, QueueBufferDuration=523000,
2021-12-21 18:32:22.278 2745-2764/com.company.app I/company.app: Background concurrent copying GC freed 302444(9364KB) AllocSpace objects, 6(116KB) LOS objects, 49% free, 17MB/35MB, paused 111us total 141.602ms
Log 2
2021-12-21 18:35:17.853 3988-4002/com.company.app I/company.app: Background young concurrent copying GC freed 163869(4913KB) AllocSpace objects, 4(80KB) LOS objects, 18% free, 19MB/24MB, paused 276us total 115.249ms
2021-12-21 18:35:19.034 3988-4002/com.company.app I/company.app: Background concurrent copying GC freed 215965(6933KB) AllocSpace objects, 2(36KB) LOS objects, 49% free, 17MB/34MB, paused 242us total 156.458ms
2021-12-21 18:35:19.222 3988-3988/com.company.app W/Looper: Slow Looper main: Long Msg: seq=3818 plan=18:35:17.582 late=1ms wall=1638ms running=0ms h=android.view.Choreographer$FrameHandler c=android.view.Choreographer$FrameDisplayEventReceiver
2021-12-21 18:35:19.231 3988-4084/com.company.app I/OpenGLRenderer: Davey! duration=1647ms; Flags=1, IntendedVsync=5073855752132, Vsync=5073855752132, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=5073856427686, AnimationStart=5073856492301, PerformTraversalsStart=5075462635071, DrawStart=5075471667686, SyncQueued=5075493524609, SyncStart=5075493730148, IssueDrawCommandsStart=5075494798225, SwapBuffers=5075502172917, FrameCompleted=5075503876917, DequeueBufferDuration=128000, QueueBufferDuration=187000,
Log 3
2021-12-22 13:54:12.253 18742-18755/com.company.app I/company.app: Background young concurrent copying GC freed 226746(7568KB) AllocSpace objects, 17(340KB) LOS objects, 29% free, 19MB/27MB, paused 295us total 113.134ms
2021-12-22 13:54:14.176 18742-18742/com.company.app W/Looper: Slow Looper main: Long Msg: seq=14797 plan=13:54:12.561 late=1ms wall=1614ms running=0ms h=android.view.Choreographer$FrameHandler c=android.view.Choreographer$FrameDisplayEventReceiver
2021-12-22 13:54:14.177 18742-18742/com.company.app W/Looper: Slow Looper main: MotionEvent is 1577ms late (event_seq=574, action=ACTION_DOWN) because of 1 msg, msg 1 took 1614ms (seq=14797 late=1ms h=android.view.Choreographer$FrameHandler c=android.view.Choreographer$FrameDisplayEventReceiver)
2021-12-22 13:54:14.177 18742-18742/com.company.app W/InputEventReceiver: App Input: 1577ms before dispatchInputEvent (MotionEvent: event_seq=574, seq=39421, action=ACTION_DOWN)
2021-12-22 13:54:14.181 18742-18742/com.company.app W/InputEventReceiver: App Input: 1291ms before dispatchInputEvent (MotionEvent: event_seq=580, seq=39483, action=ACTION_UP)
2021-12-22 13:54:14.181 18742-18755/com.company.app I/company.app: Background concurrent copying GC freed 304644(9532KB) AllocSpace objects, 5(96KB) LOS objects, 49% free, 18MB/36MB, paused 180us total 130.147ms
2021-12-22 13:54:14.182 18742-18742/com.company.app W/Looper: Slow Looper main: MotionEvent is 1174ms late (event_seq=583, action=ACTION_DOWN) because of 1 msg, msg 1 took 1614ms (seq=14797 late=1ms h=android.view.Choreographer$FrameHandler c=android.view.Choreographer$FrameDisplayEventReceiver)
2021-12-22 13:54:14.182 18742-18742/com.company.app W/InputEventReceiver: App Input: 1174ms before dispatchInputEvent (MotionEvent: event_seq=583, seq=39487, action=ACTION_DOWN)
2021-12-22 13:54:14.189 18742-18812/com.company.app I/System.out: [socket] e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaUtils
2021-12-22 13:54:14.191 18742-19626/com.company.app I/System.out: [socket] e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaUtils
2021-12-22 13:54:14.192 18742-18742/com.company.app W/InputEventReceiver: App Input: 1044ms before dispatchInputEvent (MotionEvent: event_seq=592, seq=39517, action=ACTION_UP)
2021-12-22 13:54:14.193 18742-18742/com.company.app W/Looper: Slow Looper main: MotionEvent is 953ms late (event_seq=595, action=ACTION_DOWN) because of 7 msg, msg 1 took 1614ms (seq=14797 late=1ms h=android.view.Choreographer$FrameHandler c=android.view.Choreographer$FrameDisplayEventReceiver)
2021-12-22 13:54:14.193 18742-18742/com.company.app W/InputEventReceiver: App Input: 953ms before dispatchInputEvent (MotionEvent: event_seq=595, seq=39521, action=ACTION_DOWN)
2021-12-22 13:54:14.196 18742-18742/com.company.app W/InputEventReceiver: App Input: 756ms before dispatchInputEvent (MotionEvent: event_seq=601, seq=39565, action=ACTION_UP)
2021-12-22 13:54:14.197 18742-18742/com.company.app W/Looper: Slow Looper main: MotionEvent is 607ms late (event_seq=604, action=ACTION_DOWN) because of 7 msg, msg 1 took 1614ms (seq=14797 late=1ms h=android.view.Choreographer$FrameHandler c=android.view.Choreographer$FrameDisplayEventReceiver)
2021-12-22 13:54:14.197 18742-18742/com.company.app W/InputEventReceiver: App Input: 607ms before dispatchInputEvent (MotionEvent: event_seq=604, seq=39569, action=ACTION_DOWN)
2021-12-22 13:54:14.201 18742-18742/com.company.app W/InputEventReceiver: App Input: 411ms before dispatchInputEvent (MotionEvent: event_seq=610, seq=39609, action=ACTION_UP)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:16
- Comments:19
Top Results From Across the Web
Diff - 9516ed4598948eea5623c57e443bce08c1f48ab6^2 ...
ViewOverlay} is particularly useful when you want to create -animations such as sliding a view outside of its container or moving items around...
Read more >Front-end implementation for an automatized car parking
Designing the app structure and every screen layout. • Deciding the language to work with, using different criteria like: budget, expected.
Read more >App crashing when fetching from string ressources
Issue. I have a string array in the string.xml ressources; <string-array name="errors_signup"> <item>Successful sign up</item> <item>Invalid ...
Read more >[FIXED] Fling gesture detection on grid layout ~ JavaFixing
I want to get fling gesture detection working in my Android application. ... I tried this and the methods weren't called when I...
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 Free
Top Related Reddit Thread
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

same issue with me on android
I’m facing a similar issue in my app too. My touchables stop working, and I can’t swipe through lists, change tabs etc. either.