Reputation: 123
I create the React Native Expo Mobile app. I got this error in android ERROR TypeError: _RNGestureHandlerModule.default.flushOperations is not a function (it is undefined), js engine: hermes.But,Not in IOS .how solve this error in android
Need Correct Answer. I am working On expo 50
Upvotes: 13
Views: 15388
Reputation: 1
for react native, the reason is as a result of the "react-native-gesture-handler" version is higher than the javascript version. You can reduce the version to lower version
"react-native-gesture-handler": "^1.10.3",
Upvotes: 0
Reputation: 79
Please ensure that the following dependencies and their respective versions are accurately specified in your package.json file:
"react-native": "0.73.4",
"react-native-gesture-handler": "~2.14.0",
"react-native-reanimated": "3.6.2"
Upvotes: 0
Reputation: 429
Update the dependencies in your project. this way,
for npm,
npm install @react-navigation/native@latest
npm install react-native-gesture-handler@latest
npm install react-native-reanimated@latest
for yarn,
yarn add @react-navigation/native@latest
yarn add react-native-gesture-handler@latest
yarn add react-native-reanimated@latest
Upvotes: 2
Reputation: 400
For me was different version of this package installed on the project, so be aware in case you getting such error you probably will also get this warnings in logs:
Next solution is to check if you have this package installed. A good advice for me was to follow instructions presented in errors, 90% responses is there.
Upvotes: 3
Reputation: 21
npx expo install react-native-gesture-handler
works for me ass well, don`t forget to stop the server and run again, if it still show problem try clear the expo cache:
npx expo start --clear
Upvotes: 2
Reputation: 817
I had the same issue. I had old codebase which I wanted to update with the latest versions. I was able to mitigate the issue following the below expo documentation. https://docs.expo.dev/tutorial/gestures/#install-and-configure-libraries
Upvotes: 1
Reputation: 3031
As previous answers suggest installing react-native-gesture-handler
resolves the issue.
But in the codebase react-native-gesture-handler
is not used anywhere, I don't get it, what is the purpose of installing the library that you don't use. Does it have something to do with expo
?
Upvotes: 3
Reputation: 31
I was able to install react-native-gesture-handler with
npx expo install react-native-gesture-handler
but I am still getting this error as well: ERROR TypeError: _RNGestureHandlerModule.default.flushOperations is not a function (it is undefined), js engine: hermes
I have been importing it like so
import { GestureHandlerRootView} from 'react-native-gesture-handler'
I am also only experiencing this issue on Android, but not on iOS
Upvotes: 3
Reputation: 131
I had the same issue. It got fixed when I install react-native-gesture-handler
as recommended by Pratik Prakash.
npx expo install react-native-gesture-handler
Upvotes: 13
Reputation: 975
In Expo go everything is working amazing, but development build crashing : https://forums.expo.dev/t/in-expo-go-everything-is-working-amazing-but-development-build-crashing/74480
Troubleshooting : https://reactnavigation.org/docs/4.x/troubleshooting/
Problem with the version of react-native-gesture-handler that you have installed. The error message indicates that the flushOperations method is undefined, which suggests that the method is not being exposed properly by the library.
npx expo install react-native-gesture-handler
Upvotes: 1