react-nativeexporeact-navigationreact-native-screens

Run react-native app and getting ERROR Invariant Violation: requireNativeComponent: "RNSScreenStackHeaderConfig" was not found in the UIManager


Tried every thing still I'm encountering a persistent error in my Expo app when trying to run it using npx expo start. The error message is as follows:

ERROR Invariant Violation: requireNativeComponent: "RNSScreenStackHeaderConfig" was not found in the UIManager.
This error is located at:
  in RNSScreenStackHeaderConfig (created by ScreenStackHeaderConfig)
  in ScreenStackHeaderConfig (created by HeaderConfig)
  in HeaderConfig (created by SceneView)
  in RNSScreen (created by Animated(Anonymous))
  in Animated(Anonymous)
  in Suspender (created by Freeze)
  in Suspense (created by Freeze)
  in Freeze (created by DelayedFreeze)
  in DelayedFreeze
  in InnerScreen (created by Screen)
  in Screen (created by SceneView)
  in SceneView (created by NativeStackViewInner)
  in Suspender (created by Freeze)
  in Suspense (created by Freeze)
  in Freeze (created by DelayedFreeze)
  in DelayedFreeze (created by ScreenStack)
  in RNSScreenStack (created by ScreenStack)
  in Unknown (created by ScreenStack)
  in ScreenStack (created by NativeStackViewInner)
  in NativeStackViewInner (created by NativeStackView)
  in RCTView (created by View)
  in View (created by SafeAreaProviderCompat)
  in SafeAreaProviderCompat (created by NativeStackView)
  in NativeStackView (created by NativeStackNavigator)
  in PreventRemoveProvider (created by NavigationContent)
  in NavigationContent
  in Unknown (created by NativeStackNavigator)
  in NativeStackNavigator (created by MainStack)
  in MainStack (created by App)
  in ThemeProvider (created by PaperProvider)
  in RCTView (created by View)
  in View (created by Portal.Host)
  in Portal.Host (created by PaperProvider)
  in RCTView (created by View)
  in View (created by SafeAreaInsetsContext)
  in SafeAreaProviderCompat (created by PaperProvider)
  in PaperProvider (created by App)
  in ContextProvider (created by AppDataProvider)
  in AppDataProvider (created by App)
  in ContextProvider (created by NavigationContextProvider)
  in NavigationContextProvider (created by App)
  in ContextProvider (created by AuthProvider)
  in AuthProvider (created by App)
  in EnsureSingleNavigator
  in BaseNavigationContainer
  in ThemeProvider
  in NavigationContainerInner (created by App)
  in Provider (created by App)
  in I18nextProvider (created by App)
  in RCTView (created by View)
  in View (created by GestureHandlerRootView)
  in GestureHandlerRootView (created by App)
  in RNCSafeAreaView
  in Unknown (created by App)
  in RNCSafeAreaProvider (created by SafeAreaProvider)
  in SafeAreaProvider (created by App)
  in App (created by RootApp)
  in ReactNativeProfiler (created by RootApp)
  in RCTView (created by View)
  in View (created by __Sentry.TouchEventBoundary)
  in __Sentry.TouchEventBoundary (created by RootApp)
  in RootApp (created by withDevTools(RootApp))
  in withDevTools(RootApp)
  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

Details: I've tried various solutions, but nothing has resolved the error. My app is using React Native and Expo. I suspect the issue may be related to a dependency incompatibility, but I'm not sure which one.

My Setup: Here is a summary of my dependencies in package.json:

    "dependencies": {
    "@config-plugins/react-native-callkeep": "^8.0.0",
    "@config-plugins/react-native-webrtc": "^9.0.0",
    "@gorhom/bottom-sheet": "^5.0.5",
    "@notifee/react-native": "^9.1.2",
    "@react-native-async-storage/async-storage": "^1.24.0",
    "@react-native-community/datetimepicker": "^8.2.0",
    "@react-native-community/netinfo": "^11.4.1",
    "@react-native-community/slider": "^4.5.5",
    "@react-native-firebase/analytics": "^19.0.0",
    "@react-native-firebase/app": "^19.0.0",
    "@react-native-firebase/auth": "^19.0.0",
    "@react-native-firebase/crashlytics": "^19.0.0",
    "@react-native-firebase/firestore": "^19.0.0",
    "@react-native-firebase/functions": "^19.0.0",
    "@react-native-firebase/messaging": "^19.0.0",
    "@react-native-firebase/remote-config": "^19.0.0",
    "@react-native-firebase/storage": "^19.0.0",
    "@react-navigation/material-top-tabs": "^7.0.1",
    "@react-navigation/native": "^6.1.18",
    "@react-navigation/native-stack": "^6.9.20",
    "@react-navigation/stack": "^6.4.1",
    "@reduxjs/toolkit": "^2.3.0",
    "@rneui/themed": "^4.0.0-rc.8",
    "@sentry/react-native": "^5.35.0",
    "async": "^3.2.6",
    "babel-plugin-module-resolver": "^5.0.2",
    "console-table-printer": "^2.12.1",
    "currency-master": "^1.1.0",
    "expo": "~51.0.28",
    "expo-av": "^14.0.7",
    "expo-camera": "^16.0.4",
    "expo-contacts": "^13.0.5",
    "expo-dev-client": "^4.0.29",
    "expo-device": "^6.0.2",
    "expo-image-manipulator": "^12.0.5",
    "expo-image-picker": "^15.0.7",
    "expo-linking": "^6.3.1",
    "expo-localization": "^15.0.3",
    "expo-location": "^17.0.1",
    "expo-media-library": "^16.0.5",
    "expo-notifications": "^0.28.19",
    "expo-splash-screen": "^0.27.6",
    "expo-status-bar": "~1.12.1",
    "expo-updates": "^0.25.27",
    "firebase": "^11.0.1",
    "i18next-intervalplural-postprocessor": "^3.0.0",
    "intl-pluralrules": "^2.0.1",
    "jssip": "^3.10.1",
    "libphonenumber-js": "^1.11.14",
    "moment": "^2.30.1",
    "moment-timezone": "^0.5.46",
    "patch-package": "^8.0.0",
    "react": "18.2.0",
    "react-i18next": "^15.1.1",
    "react-native": "0.74.5",
    "react-native-android-finish": "^1.2.1",
    "react-native-background-timer": "^2.4.1",
    "react-native-bouncy-checkbox": "^4.1.2",
    "react-native-callkeep": "^4.3.14",
    "react-native-copilot": "^3.3.2",
    "react-native-fast-image": "^8.6.3",
    "react-native-flash-message": "^0.4.2",
    "react-native-gesture-handler": "^2.20.0",
    "react-native-image-viewing": "^0.2.2",
    "react-native-incall-manager": "^4.2.0",
    "react-native-linear-gradient": "^2.8.3",
    "react-native-masked-text": "^1.13.0",
    "react-native-modal": "^13.0.1",
    "react-native-paper": "^5.12.5",
    "react-native-permissions": "^5.1.0",
    "react-native-reanimated": "^3.16.1",
    "react-native-restart": "^0.0.27",
    "react-native-safe-area-context": "^4.11.1",
    "react-native-screens": "^3.29.0",
    "react-native-share": "^11.0.4",
    "react-native-shimmer-placeholder": "^2.0.9",
    "react-native-sound": "^0.11.2",
    "react-native-svg": "^15.8.0",
    "react-native-uuid": "^2.0.3",
    "react-native-vision-camera": "^4.6.1",
    "react-native-webrtc": "^124.0.4",
    "react-redux": "^9.1.2",
    "text-encoding": "^0.7.0",
    "use-context-selector": "^2.0.0"
  },

Steps I have done:

  1. deleted node_modules & package-lock.json
  2. deleted Pods & Podfile.lock
  3. npm cache clean --force
  4. npm install
  5. pod install
  6. npx expo start --clear
  7. Upgraded/downgraded relevant libraries like react-native-screens and react-navigation.

Questions:

Any guidance would be greatly appreciated!


Solution

  • I resolved this issue by upgrading the relevant navigation dependencies in my package.json. Here's the updated version of the dependencies that fixed the problem:

    "@react-navigation/native": "^7.0.0",
    "@react-navigation/native-stack": "^6.11.0",
    "@react-navigation/stack": "^7.0.0",