react-native-reanimated: Android remote debugging: Calling synchronous methods on native modules is not supported in Chrome
Description
Android remote debugging was supposed to be fixed in a previous version, however, I updated reanimated
to 2.70
and I’m still having some issue when I enable remote debugging as shown in the screenshot.
I believe this part of react-native
is causing the issue
https://github.com/facebook/react-native/blob/main/Libraries/BatchedBridge/MessageQueue.js#L168
Expected behaviour
Remote debugging should work fine on Android
Actual behaviour & steps to reproduce
Open dev menu on Android and press Debug
Snack or minimal code example
Package versions
2.7.0
name | version |
---|---|
react-native | 67.3 |
react-native-reanimated | 2.7.0 |
NodeJS | 16.14.2 |
Java | openjdk 11.0.11 2021-04-20 |
Affected platforms
- Android
- iOS
- Web
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 12
- Comments: 15 (1 by maintainers)
Commits related to this issue
- Fix Android remote debugging failure due to calling synchronous methods on native modules in Chrome (#3227) ## Description This fixes the remote debugging failure on Android using Chrome as instal... — committed to software-mansion/react-native-reanimated by justin-tay 2 years ago
- Fix Android remote debugging failure due to calling synchronous methods on native modules in Chrome (#3227) ## Description This fixes the remote debugging failure on Android using Chrome as instal... — committed to software-mansion/react-native-reanimated by justin-tay 2 years ago
- Fix Android remote debugging failure due to calling synchronous methods on native modules in Chrome (#3227) ## Description This fixes the remote debugging failure on Android using Chrome as instal... — committed to sunnylqm/react-native-reanimated by justin-tay 2 years ago
I have then same issue , when I used ~2.4.1 then can work fine.
Fixed it temporarily by editing the /node_modules/react-native-reanimated/src/reanimated2/NativeReanimated/NativeReanimated.ts following this commit: https://github.com/sunnylqm/react-native-reanimated/commit/77dcf4a80f95216a348aab1b94677f652f5199fc
Hi, I’m having the same issue, in my case, I’m using @react-navigation/drawer. I’m using React-Native 0.68 and React-Native-Reanimated 2.7.0. For some reason, the line const DrawerNavigator = createDrawerNavigator(); throws this error: Invariant Violation: Calling synchronous methods on native modules is not supported in Chrome. If the line is commented the app starts.
I’m facing the same issue with
react-native
version0.68.0
andreanimated
version2.7.0
2.8.0
is borked, but2.9.0
is definitely fixed: https://github.com/software-mansion/react-native-reanimated/blob/2.9.0/src/reanimated2/NativeReanimated/NativeReanimated.tsI have the same issue. This is my package.json: