Surendhar S
Surendhar S

Reputation: 123

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

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

Answers (10)

Jerry Azubuike
Jerry Azubuike

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

elie mardelly
elie mardelly

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

Isuru Bandara
Isuru Bandara

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

BASKA
BASKA

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: 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.

Upvotes: 3

didi katz
didi katz

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

Avik
Avik

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

Ismoil Shokirov
Ismoil Shokirov

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?

enter image description here

Upvotes: 3

moogen
moogen

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

Dessale Fessehaye
Dessale Fessehaye

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

Pratik Prakash Bindage
Pratik Prakash Bindage

Reputation: 975

Upvotes: 1

Related Questions