react native navigation TypeError: null is not an object (evaluating '_RNGestureHandlerModule.default.handleSetJSResponder')

Viewed 1898

I follow the steps of react-native docs.

npx react-native init SelfApp --template react-native-template-typescript

and then follow the steps of react-native-navigation.

yarn add @react-navigation/native 
yarn add react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view

then i add code

import 'react-native-gesture-handler';

to the first line of app.tsx.

then run yarn start, I got this error.

error

i tried a lot of times, but still in trouble, and here is my package.json

enter image description here

1 Answers

Hey according to this discussion on react-native-gesture-handler's GitHub, it's either a problem of linking, if you are on Android or a problem of some pods not being installed if you are on iOS.

It would be helpful to know which version of React Native you are using because if it's >= 60, it should support auto-linking, and if it is < 60, you should link the library manually.

In that last case: Try these steps

For iOS:

$ cd ios

$ pod install

Another possible solution that has worked for other people, according to the discussion I mentioned above (see this specific response):

1 - Delete/Remove your node_modules directory

rm -rf node_modules

2 - Install your dependencies again

If you are using Yarn $ yarn install or if you are using npm npm install

3 Clean your Gradle

cd android
./gradlew clean
cd ..
react-native run-android
Related