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

前端 未结 20 772
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 04:52

    Uninstalled the app from the device and run the android project - react-native run-android and it worked fine

    0 讨论(0)
  • 2020-12-01 04:53

    I get the same error on ios from RN v0.60

    The following worked for me:

    cd ios
    pod install
    
    0 讨论(0)
  • First, remove node_modules and package-lock.json and run npm install. After installing the react-navigation package in your React Native project. You should install react-native-gesture-handler. If you’re using Expo you don’t need to do anything here, it’s included in the SDK. Otherwise:

    npm install react-native-gesture-handler

    And finally, link gesture dependency as:

    react-native link react-native-gesture-handler

    This answer based on the React Navigation document.

    0 讨论(0)
  • 2020-12-01 04:57

    Execute the following commands in command prompt (Run as Administrator)

     npm install react-navigation
     npm install react-native-gesture-handler
     npm intstall
     react-native link
    

    Re-Install the application will resolve the issue.

    0 讨论(0)
  • 2020-12-01 04:58

    If you are using react-link to link your dependencies:

    1. 0pen your ios Podfile and delete all yout linked dependencies: pod 'xxxxxxx', :path => '../node_modules/xxxxx
    2. Close Xcode
    3. In your /ios folder run "pod update"
    4. In your project source run "react-native link"
    5. Open Xcode and Clean Build Folder from Xcode Menu -> Product
    6. Run your application from Xcode
    7. Link manually the dependency "react-native-gesture-handler" into your Xcode Project following steps in documentation: https://facebook.github.io/react-native/docs/linking-libraries-ios
    8. Now run your application from Xcode, you should be fine.
    0 讨论(0)
  • 2020-12-01 04:59

    if you have done the above, it hasn't run yet, try this if you use Windows

    cd android 
    
    .\gradlew cleanBuildCache
    

    and try running it

    react-native run-android 
    
    0 讨论(0)
提交回复
热议问题