-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Upgrading 0.72.0-rc.5 with 3.2.0 causes runtime error with metro. #4521
Comments
Hey! 👋 The issue doesn't seem to contain a minimal reproduction. Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem? |
Getting the same with react-native 0.71.8 - tried resetting metro cache, clearing node modules, clearing Pods dir and Podfile.lock, clearing derived data and clean build in xcode as well as a machine and phone restart with no luck |
Hey @gtokman, thanks for reporting this issue. We're actively working on it but adding support for upcoming releases is not that easy these days. Will keep you updated! |
## Summary This PR bumps react-native to 0.72.0-rc.5 and slightly changes initialization path on iOS (Paper) due to recent changes in the framework (facebook/react-native#37523). Fixes #4521. Continues #3005. On iOS, Reanimated needs to overwrite two React internal modules: * `RCTUIManager` → `REAUIManager` to intercept `manageChildren` calls in order to observe React tree changes ([here](https://github.com/software-mansion/react-native-reanimated/blob/main/ios/LayoutReanimation/REAUIManager.mm)) * `RCTEventDispatcher` → `REAEventDispatcher` to intercept events in the native code while still on the UI thread ([here](https://github.com/software-mansion/react-native-reanimated/blob/663ee74925cafa4a1a802f4722466dc02cb1760f/ios/REAEventDispatcher.m#L9-L10)) The rest of the initialization (injecting JSI bindings) can be safely done in `installTurboModule` method, as we already do on Android and iOS/Fabric. Previously, this was done using categories (see [`UIResponder+Reanimated.mm`](https://github.com/software-mansion/react-native-reanimated/blob/663ee74925cafa4a1a802f4722466dc02cb1760f/ios/native/UIResponder%2BReanimated.mm#L19-L30)), in particular by overwriting `jsExecutorFactoryForBridge:` method which is called during initialization. However, since 0.72.0-rc.4, this method is already implemented in `RCTAppDelegate` so the trick does no longer work, making the app fail with the following error "[Reanimated] The native part of Reanimated doesn't seem to be initialized". In this PR, I've used a category to overwrite another method `extraModulesForBridge` which swizzles the implementation of `jsExecutorFactoryForBridge` method and runs `REAInitializer` before the original call. As suggested by @kmagiera, alternatively we could just swizzle the methods of `RCTUIManager` and `RCTEventDispatcher`. ## TODO - [x] Restore support for 0.71 and below with #ifdefs ## Test plan <!-- Provide a minimal but complete code snippet that can be used to test out this change along with instructions how to run it and a description of the expected behavior. -->
@firehand33 Did you rebuild the native part of the app after upgrading Reanimated? |
Hi, @tomekzaw Thanks for looking into and working on this.
I have tried everything from the above conversation. iOS iPhone 14, iOS 16.4 Pods > Developement Pods > RNReanimated: I have also tried using various combinations of previous react-native versions along with earlier versions of react-native-reanimated. Nothing worked. Do you see anything here that is causing the error? Let me know if you need any other details of my react-native configuration. Thanks in advance. |
@samir-anghan maybe a long shot but can you add this in your
right under the
Edit: just saw the issue is for iOS 🤦♂️ |
@efstathiosntonas Thanks for the suggestion, tried it but did not work. |
@samir-anghan did you tried running metro bundler with before doing so open terminal and run |
@efstathiosntonas Yes, tried, but unfortunately, none of these helped - clearing metro cache, clearing node modules, clearing Pods folder and deleting Podfile.lock, clearing derived data and running the clean build in Xcode :( Tried everything that I could think of. Any further suggestions are appreciated. |
Hey @samir-anghan, I've tried to reproduce the problem but it works for me. Here's what I did:
I'm afraid this problem might be specific to your application. |
I am also having this error in my app. I upgraded to 2.2.4 to 3.3.0 and I am getting this error. Cant seem to find a fix. |
I upgraded from 2.14.4 to 3.3.0 and am now seeing this error. How exactly should the native part be initialized? Should I call something in AppDelegate? RN version is 0.72.0 |
@tapz It should be installed automatically, at least it works this way in a fresh RN 0.72.0 app. Do you have some custom native code (like AppDelegate written in Swift) or something like this? |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This seems to be fixed with the combo of RN 0.72.x and RNR 3.4.x (So no need to mess with AppDelegate files) NOTE: Remember to do |
This comment was marked as spam.
This comment was marked as spam.
Still getting this issue for android (could be for IOS as well, havent checked cuz running windows). |
I too have same configuration and same issue.. |
Solution
|
Description
I'm experiencing an error after upgrading RN to
0.72.0-rc.5
. I tried reseting the cache withyarn start --reset-cache
too.Steps to reproduce
0.72.0-rc.5
Snack or a link to a repository
n/a
Reanimated version
3.2.0
React Native version
0.72.0-rc.5
Platforms
iOS
JavaScript runtime
None
Workflow
React Native (without Expo)
Architecture
Paper (Old Architecture)
Build type
Debug mode
Device
iOS simulator
Device model
No response
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: