navigation drawer - React Native: "TurboModuleRegistry.getEnforcing(...): 'RNGestureHandlerModule' coul

Question:(I don't use IOS)I am working on a React Native project and encountering the following

Question:

(I don't use IOS) I am working on a React Native project and encountering the following error when trying to run the app on an Android emulator:

ERROR  Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNGestureHandlerModule' could not be found. Verify that a module by this name is registered in the native binary., js engine: hermes

Additionally, I get this error:

ERROR  Invariant Violation: "EveryThink" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.

Project Setup & Versions:

  • React Native Version: 0.74.0

  • react-native-gesture-handler Version: 2.24.0

  • react-navigation Version: 7.1.1

  • @react-navigation/drawer Version: 7.1.1

  • @react-navigation/native Version: 6.1.8

  • Android Emulator: API Level 33

  • Java Version: 17

  • Node.js Version: 18.x

  • NPM Version: 9.x

  • OS: Windows 10


Question:

How can I resolve this issue? Is there anything else I need to check or configure to make react-native-gesture-handler work correctly?

Reinstalled react-native-gesture-handler

  1. npm uninstall react-native-gesture-handler
    npm install react-native-gesture-handler 
    
  2. Cleared Metro Bundler cache and restarted the server

    npx react-native start --reset-cache
    
  3. Cleaned the Android build

    cd android && ./gradlew clean && cd ..
    
  4. Ensured react-native-gesture-handler is imported at the top of index.js

    import 'react-native-gesture-handler';
    
  5. Checked MainActivity.java for necessary imports

    import com.swmansion.gesturehandler.react.RNGestureHandlerEnabledRootView;
    
  6. Rebuilt the project

    npx react-native run-android
    

Despite these steps, I am still encountering the same issue.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745153102a4613954.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信