expo / router

[ARCHIVE]: Expo Router has moved to expo/expo -- The File-based router for universal React Native apps

Home Page:https://docs.expo.dev/routing/introduction/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[v2] requireNativeComponent: "RNGestureHandlerRootView" was not found in the UIManager.

7ammer opened this issue · comments

commented

Which package manager are you using? (Yarn is recommended)

npm

Summary

Expected
Expect app to not produce errors after following 'Minimal reproducible example'. See 'Error stack' for errors.

Work around

  1. Remove main in package.json
  2. Run npx expo install react-native-gesture-handler
  3. Create index.js file at the root of the project containing: import 'react-native-gesture-handler'; import "expo-router/entry";
  4. Re-run npx expo run:android

Error stack

Android Bundling complete 8226ms
 ERROR  [react-native-gesture-handler] react-native-gesture-handler module was not found. Make sure you're running your app on the native platform and your code is linked properly (cd ios && pod install && cd ..).

For installation instructions, please refer to https://docs.swmansion.com/react-native-gesture-handler/docs/#installation
 ERROR  Invariant Violation: requireNativeComponent: "RNGestureHandlerRootView" was not found in the UIManager.

This error is located at:
    in RNGestureHandlerRootView (created by GestureHandlerRootView)
    in GestureHandlerRootView (created by GestureHandlerRootView)
    in GestureHandlerRootView (created by wrapper)
    in wrapper (created by ContextNavigator)
    in EnsureSingleNavigator
    in BaseNavigationContainer
    in ThemeProvider
    in NavigationContainerInner (created by ContextNavigator)
    in ContextNavigator (created by ExpoRoot)
    in ExpoRoot (created by App)
    in App (created by withDevTools(App))
    in withDevTools(App) (created by ErrorOverlay)
    in ErrorToastContainer (created by ErrorOverlay)
    in ErrorOverlay
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in main(RootComponent), js engine: hermes
 WARN  Possible Unhandled Promise Rejection (id: 0):
Invariant Violation: requireNativeComponent: "RNGestureHandlerRootView" was not found in the UIManager.
Invariant Violation: requireNativeComponent: "RNGestureHandlerRootView" was not found in the UIManager.
    at invariant (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:2411:26)
    at getNativeComponentAttributes (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:11592:14)
    at anonymous (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:65067:42)
    at anonymous (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:11093:28)
    at createInstance (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:86095:46)
    at completeWork (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:94799:48)
    at completeUnitOfWork (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:98036:34)
    at performUnitOfWork (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:98012:29)
    at workLoopSync (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:97938:28)
    at renderRootSync (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:97915:25)
    at performSyncWorkOnRoot (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:97640:40)
    at flushSyncCallbacks (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:86832:36)
    at flushSyncCallbacksOnlyInLegacyMode (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:86814:29)
    at scheduleUpdateOnFiber (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:97201:47)
    at dispatchSetState (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:90961:34)
    at ?anon_0_ (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:146013:23)
    at next (native)
    at asyncGeneratorStep (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:5980:26)
    at _next (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:5999:29)
    at tryCallOne (/root/react-native/packages/react-native/ReactAndroid/hermes-engine/.cxx/Release/4i495j47/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:53:16)
    at anonymous (/root/react-native/packages/react-native/ReactAndroid/hermes-engine/.cxx/Release/4i495j47/arm64-v8a/lib/InternalBytecode/InternalBytecode.js:139:27)
    at apply (native)
    at anonymous (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:39485:26)
    at _callTimer (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:39364:17)
    at _callReactNativeMicrotasksPass (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:39409:17)
    at callReactNativeMicrotasks (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:39615:44)
    at __callReactNativeMicrotasks (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:3568:46)
    at anonymous (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:3342:45)
    at __guard (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:3541:15)
    at flushedQueue (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:3341:21)
    at invokeCallbackAndReturnFlushedQueue (http://localhost:8081/index.bundle//&platform=android&dev=true&minify=false&app=com.amperative.lectio365&modulesOnly=false&runModule=true:3335:33)
 
 

Minimal reproducible example

  1. npx create-expo-app@latest --template tabs@49
  2. npx expo run:android
  3. See error on physical device.

Followed the instructions exactly, couldn't reproduce. Ensure the react-native-gesture-handler package is installed in the project package.json.