react-native-gesture-handler: [Android] [RN 0.56.0] Invariant Violation: requireNativeComponent: "GestureHandlerRootView" was not found in the UIManager.

I’m getting the following error when starting my App on Android (in Debug) with RN 0.56.0:

error

Is anyone else seeing this error, or has seen it before?

Some additional information

I’m using react-native-navigation and followed the guide to replace my Views with gestureHandlerRootHOC(…) in Navigation.registerComponent(…).

I’m starting a tab-based App (Navigation.startTabBasedApp(…)), where Profile is the last tab. If I remove Profile, the now last tab will be where the error occurs.

I made Profile render just a single View. If there are nested Views, the Error occurs in the first Component without children.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 25 (3 by maintainers)

Most upvoted comments

@abhidatta0 It did not solve it for me. my app works fine when I use Expo Go but I keep getting the error when I run the developer build of the app: Invariant Violation: requireNativeComponent: "RNGestureHandlerRootView" was not found in the UIManager.

This issue i had when using react-navigation in a project .Installing gesture-handle library solved this. import 'react-native-gesture-handler'

Just published 1.0.6 that includes this fix. Thanks everyone for reporting and testing the fix!

After a week of trying various solutions, I had to add the following in the android/build.gradle and then do an “npx react-native run-android” to fix this issue (typing it here so it might help someone else)

buildscript { ext { ... kotlinVersion = "1.5.20" } }

delete the node modules, run expo install and then expo install react-native-gesture-handler

Ah, looks like @mars-lan is right. We should revert the change that removed view manager for GestureHandlerRootView. Should have a fix ready shortly

@kmagiera

https://github.com/kmagiera/react-native-gesture-handler/pull/199 seems to be the culprit. Still need a ViewManager to expose RNGestureHandlerRootView to JS side.

npm install --save react-native-gesture-handler

I did this and it fixed it, I don’t use expo though so for me it was just npm i

am geting the error npm start

moviemobile@1.0.0 start expo start

WARNING: expo-cli has not yet been tested against Node.js v17.6.0. If you encounter any issues, please report them to https://github.com/expo/expo-cli/issues

expo-cli supports following Node.js versions:

  • =12.13.0 <13.0.0 (Maintenance LTS)

  • =14.0.0 <15.0.0 (Active LTS)

  • =15.0.0 <17.0.0 (Current Release)

Starting project at /home/native/Documents/nativeApp/MovieMobile Developer tools running on http://localhost:19002 Some dependencies are incompatible with the installed expo package version:

  • react-native-gesture-handler - expected version: ~2.1.0 - actual version installed: 2.3.0
  • react-native-safe-area-context - expected version: 3.3.2 - actual version installed: 4.1.2 Your project may not work correctly until you install the correct versions of the packages. To install the correct versions of these packages, please run: expo doctor --fix-dependencies, or install individual packages by running expo install [package-name …] Starting Metro Bundler ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ █ ▄▄▄▄▄ █▄▀▀▄▄ ██ █ ▄▄▄▄▄ █ █ █ █ ███▄█ ▄▄█ █ █ █ █ █▄▄▄█ ██▄▀▄▀▀██▀█ █▄▄▄█ █ █▄▄▄▄▄▄▄█ █ ▀▄▀ ▀ █▄▄▄▄▄▄▄█ █ ▄▀ ▀▄█▀ ▄▄▀▀█▀ █▄█▀█▀▀▄█ ██ ▄ ▄ ▄▄ ▀ ▀▄▄▄▀▀███▄▀▀ █ █ █ █▄▄ ▀▄█▄▄▀▄▀█ ▄▀▀█▀ ██ █ ▄██ ▄▄ ▄██ ▄▄█ ▄▀ ██▄▀ █ █▄█▄██▄▄█ █▀▀ █ ▄▄▄ ▄▀▄█ █ ▄▄▄▄▄ ██▄▄▄ ▄█ █▄█ ██▀ █ █ █ █ █ ▄ ▀▀██▄ ▄ ▄ █▀▀█ █ █▄▄▄█ █▀▀ █▄ ▄█▀▀▄█ █ █▄▄▄▄▄▄▄█▄▄█▄██▄▄▄▄█▄▄███▄█

› Metro waiting on exp://192.168.8.152:19000 › Scan the QR code above with Expo Go (Android) or the Camera app (iOS)

› Press a │ open Android › Press w │ open web

› Press r │ reload app › Press m │ toggle menu › Press d │ show developer tools › shift+d │ toggle auto opening developer tools on startup (disabled)

› Press ? │ show all commands

Logs for your project will appear below. Press Ctrl+C to exit. › Reloading apps Android Bundling complete 6653ms Android Running app on SM-A115F

[react-native-gesture-handler] Seems like you’re using an old API with gesture components, check out new Gestures system! at node_modules/react-native-gesture-handler/src/handlers/createHandler.ts:153:4 in showRngh2NoticeIfNeeded at node_modules/react-native-gesture-handler/src/handlers/createHandler.ts:203:31 in Handler#constructor at node_modules/react-native/Libraries/ReactNative/renderApplication.js:58:4 in renderApplication at node_modules/react-native/Libraries/ReactNative/AppRegistry.js:117:25 in runnables.appKey.run at node_modules/react-native/Libraries/ReactNative/AppRegistry.js:202:4 in runApplication

Invariant Violation: requireNativeComponent: “RNGestureHandlerRootView” was not found in the UIManager.

This error is located at: in RNGestureHandlerRootView (created by GestureHandlerRootView) in GestureHandlerRootView (created by StackView) in StackView (created by StackView) in StackView in Unknown (created by Navigator) in Navigator (created by NavigationContainer) in NavigationContainer (created by ExpoRoot) in ExpoRoot in RCTView (created by View) in View (created by AppContainer) in RCTView (created by View) in View (created by AppContainer) in AppContainer at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException at node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException at node_modules/react-native/Libraries/Core/ReactFiberErrorDialog.js:43:2 in showErrorDialog at node_modules/react-native/Libraries/ReactNative/renderApplication.js:58:4 in renderApplication at node_modules/react-native/Libraries/ReactNative/AppRegistry.js:117:25 in runnables.appKey.run at node_modules/react-native/Libraries/ReactNative/AppRegistry.js:202:4 in runApplication

Invariant Violation: requireNativeComponent: “RNGestureHandlerRootView” was not found in the UIManager.

This error is located at: in NavigationContainer (created by ExpoRoot) in ExpoRoot in RCTView (created by View) in View (created by AppContainer) in RCTView (created by View) in View (created by AppContainer) in AppContainer at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException at node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException at node_modules/react-native/Libraries/Core/ReactFiberErrorDialog.js:43:2 in showErrorDialog at node_modules/react-native/Libraries/ReactNative/renderApplication.js:58:4 in renderApplication at node_modules/react-native/Libraries/ReactNative/AppRegistry.js:117:25 in runnab

i delete node_module and did the installation npm install --save react-native-gesture-handler

Facing the same issue

just Install This lib: yarn add react-native-safe-area-context it worked for me every time

same error on iOS hasn’t anybody solved this issue yet ?