-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GestureHandler already initialized for root view #7148
Comments
Closing due to no repro. If this still occurs with the latest versions, please open a new issue with a repro. |
I am having the same problem. I don´t know why. |
I restarted Metro Bundler. Error gone |
Any update? |
I have this error aswell at random times. Cant seem te reproduce it manually. |
I can't think of a scenario a screen would unmount when opening. So it's probably a safe-bet to always call onClose. Fixes #136
Same here, after restart Expo the error gone. I didn't touch the code. Just developing a starter project with latest RN and RNN@next. |
just restart your app on device, Metro Bundler, error should gone |
We're getting this crash in production builds. Open to suggestions on how to debug this in that env |
@grantgeorge I too have been fighting this in production. It's been affecting ~1% of sessions among my Android users on recent production builds. I am not 100% sure, but my investigation so far points to a possible bad interaction between I am currently testing this possible fix, which prevents the app's MainActivity from being destroyed and re-created as often: https://stackoverflow.com/a/60360452 My suspicion is that something goes haywire in terms of the MainActivity lifecycle and the UI elements it manages, maybe due to incomplete handling of onHostDestroy()/onHostResume(), or a race condition between JavaScript and native Java code. Note, I am still on react-navigation 3.13, so I'm not 100% sure this applies to more recent versions. I have a pretty heavy-duty navigation setup with many nested tabs, stacks, and switches, so I'm probably stressing the |
@danmaas thanks for sharing that. Glad I'm not alone! If it's helpful, I've found that this crash and similarly related crashes to gesture handler and/or react-navigation occur after a user has downloaded a CodePush update and the sync at least started. That's about as far as I've gotten with this and I'm doing some more digging later. From your example, my hypothesis is that users are downloading & syncing the CodePush update which shows a white screen and trying to exit that flow by clicking hardware back. |
Interesting, thanks for the info. I am also using CodePush, although only in "ON_NEXT_RESTART" install mode, so the bundle update doesn't happen during normal app usage. I haven't seen any new crashes since deploying the MainActivity changes above, but it's a little too early to be sure. |
It's been a couple more days and I have not seen any more cases of this GestureHandler crash after making the changes to MainActivity as described above. |
thanks @danmaas . Followed your suggestion and haven't seen the error since. Cheers! |
Although folks above have been saying that restarting the Metro Bundler would fix itself, I had to take it further and rebuild Android/iOS apps with npx to actually see it being fixed |
Hey! This issue is closed and isn't watched by the core team. You are welcome to discuss the issue with others in this thread, but if you think this issue is still valid and needs to be tracked, please open a new issue with a repro. |
Just restart the Metro Bundler |
Exit from everything and restart all again. This fixed my error. |
This fixed my error: npm install --save react-native-gesture-handler |
I will occasionally get this error, but I am not sure how to reproduce it. All I know is that it is related to the stack navigator and how it implements react native gesture handler. When I switch it to another navigator like bottom tab, it does not throw error. I can only prevent the error temporarily by closing the app and opening it back up.
Platform: Android
The text was updated successfully, but these errors were encountered: