react-native-gesture-handler: RN 0.61 Release Build - 'Unhandled JS Exception: Invariant Violation: Unsupported top level event type "onGestureHandlerStateChange" dispatched
Hello I’m encoutering app crashes during release mode on both, iOS and Android after RN 0.60 to 0.61 upgrade.
I’m enclosing error from xCode console:
2019-10-04 08:56:06.922 [error][tid:com.facebook.react.JavaScript] Invariant Violation: Unsupported top level event type "onGestureHandlerStateChange" dispatched
2019-10-04 08:56:06.924 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: Invariant Violation: Unsupported top level event type "onGestureHandlerStateChange" dispatched
2019-10-04 08:56:06.926353+0200 eks_golf_ng[5301:1138125] *** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: Invariant Violation: Unsupported top level event type "onGestureHandlerStateChange" dispatched', reason: 'Unhandled JS Exception: Invariant Violation: Unsupported top level event type "onGestureHandlerStateChange" dispatched, stack:
extractEvents@171:13016
<unknown>@171:13807
_e@171:89649
ke@171:13544
Re@171:13717
receiveEvent@171:14132
value@56:3662
<unknown>@56:764
value@56:2868
value@56:736
value@<null>:<null>
'
*** First throw call stack:
(0x197f41c30 0x197c5c0c8 0x1006f575c 0x100767644 0x197f48724 0x197e11280 0x197e11e90 0x100728190 0x10072a2a0 0x10072a004 0x100fe1e48 0x100fe32a8 0x100fea938 0x100feb528 0x100ff64e8 0x197c4eaa0 0x197c54c78)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Does anyone encounter same issue? I will do my best to add reproducible demo ASAP.
Thank you so much for any help!
"react-native": "0.61.2",
"react-native-gesture-handler": "^1.4.1",
"react-native-reanimated": "^1.3.0",
"react-native-redash": "^8.1.2",
"react-native-screens": "^2.0.0-alpha.3",
"reanimated-bottom-sheet": "^1.0.0-alpha.14",
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 35
- Comments: 24
I’ve opened a new issue before research and I’m so sorry for that…
I added
at top of
index.js
file as suggested in #320 and it works now 😸I love those kind of magic fix, it ensures me that no one will ever take my place in the company, thank you again for that. Please do not ever document this.
Suggested fix doesn’t work for me.
Just to add to the noise in this thread…The proposed fix works for me, but it has to literally be the very first thing imported in root index.js or the crashing behaviour persists. If it wasn’t clear above, make sure the import is the first line of index.js!
We’re still seeing this problem.
RN 0.61.5
andreact-native-gesture-handler 1.6.0
. Our app is crashing randomly when testing. The problem even occurs when the app is in the background. Production only and low repeat frequency, it takes about 30m -1h30m to reproduce. We’re using thereact-native-gusture-handler
for a custom bottom sheet implementation.According to this comment, this issue has been fixed by
react-native-gesture-handler: 1.5.2
. I can confirm that this version works for me on Android 😄(theimport 'react-native-gesture-handler'
workaround is no longer needed).Same problem, I have many crash in my Firebase Crashlytics. It’s difficult to reproduce on simulator. But before RN 0.61 i hadn’t this crash.
this is working for me! thanks!!
Hello!
Added import “react-native-gesture-handler”; and solved my problem. I was having this issue only on release, and who still has the issue after add the import, try to clean the cache of the apk. I had this problem and stook on it after the add because of the cache, when I generate a clean apk, the problem was solved =)
@phyuthinkyi I think the import fixes iOS only. For Android, I found something else was necessary, detailed here, though for me I only got the crash in production, you’re getting it in a simulator, so the circumstances may not be the same.
This issue has idd been addressed in a new release. No need to share workarounds. Just update to the latest version.
i had to put it at the very root index.js. i wish this could get a real fix, maybe requiring an import in other libraries so that this doesnt get dropped from the code?
I had the same issue , does anyone knows the reason behind this ? Pardon if its really basic thing and idk 😛