Skip to content
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

Unity doesn't load after reloading in metro bundler (Android) #127

Open
carlandren2002 opened this issue Aug 10, 2024 · 2 comments
Open

Comments

@carlandren2002
Copy link

Unity loads perfectly and works each time I run "npm run android" but if I reload the app by pressing R in the metro bundler, I can't get the UnityView to load anymore.

Is there any way to fix this? Will it be a problem in the final version of the app?

@markrickert
Copy link

The lifecycle methods aren't reliably called on fast refresh. Try adding this to the top of your unity file:

// https://reactnative.dev/docs/fast-refresh#fast-refresh-and-hooks
// @refresh reset

@carlandren2002
Copy link
Author

Unfortunately it still freezes whenever a fast refresh is performed (only if the Unity view is visible). But I take it as if this isn't a problem in production since it's specifically during a fast refresh this happens?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants