undefined is not an object (evaluating 'RNGestureHandlerModule.State'

前端 未结 20 776
Happy的楠姐
Happy的楠姐 2020-12-01 04:43

I have installed react-navigation in my React Native project. Its a starter project doesn\'t have any codes. But while running project I am facing

20条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-01 05:04

    Since I am not allowed to comment, I am posting it here. This is the answer by @Amiri Houssem but I am adding one more thing:

    1. remove node_modules and package-lock.json
    2. npm install
    3. npm install --save react-navigation
    4. npm install --save react-native-gesture-handler
    5. react-native link

    If there is an error even after these 5 steps, check android/settings.gradle and change that line to this:

    project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
    

提交回复
热议问题