ERROR TypeError: _RNGestureHandlerModule.default.flushOperations is not a function (it is undefined), js engine: hermes

7.6k views Asked by At

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

8

There are 8 answers

0
Pratik Prakash Bindage On
0
Dessale Fessehaye On

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
0
moogen On

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

0
Ismoil Shokirov On

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?

enter image description here

0
Avik On

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

0
didi katz On
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
0
BASKA On

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: error when is installed different version of react-native-gesture-handler

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.

1
Isuru Bandara On

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