Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invariant Violation: requireNativeComponent: "RNSModalScreen" was not found in the UIManager. #11926

Open
4 of 11 tasks
ayushthumar opened this issue Apr 3, 2024 · 19 comments
Open
4 of 11 tasks

Comments

@ayushthumar
Copy link

ayushthumar commented Apr 3, 2024

Current behavior

Below is my code and I am not using expo, I am using the react-native cli:

import * as React from 'react';
import { Text, View } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';

function HomeScreen() {
  return (
    <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
      <Text>Home!</Text>
    </View>
  );
}

function SettingsScreen() {
  return (
    <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
      <Text>Settings!</Text>
    </View>
  );
}

const Tab = createBottomTabNavigator();

export default function App() {
  return (
    <NavigationContainer>
      <Tab.Navigator>
        <Tab.Screen name="Home" component={HomeScreen} />
        <Tab.Screen name="Settings" component={SettingsScreen} />
      </Tab.Navigator>
    </NavigationContainer>
  );
}

This is the error I am getting

Invariant Violation: requireNativeComponent: "RNSModalScreen" was not found in the UIManager.

This error is located at:
in RNSModalScreen
in Unknown (created by InnerScreen)
in Suspender (created by Freeze)
in Suspense (created by Freeze)
in Freeze (created by DelayedFreeze)
in DelayedFreeze (created by InnerScreen)
in InnerScreen (created by Screen)
in Screen (created by MaybeScreen)
in MaybeScreen (created by BottomTabView)
in RNSScreenNavigationContainer (created by ScreenContainer)
in ScreenContainer (created by MaybeScreenContainer)
in MaybeScreenContainer (created by BottomTabView)
in RNCSafeAreaProvider (created by SafeAreaProvider)
in SafeAreaProvider (created by SafeAreaProviderCompat)
in SafeAreaProviderCompat (created by BottomTabView)
in BottomTabView (created by BottomTabNavigator)
in PreventRemoveProvider (created by NavigationContent)
in NavigationContent
in Unknown (created by BottomTabNavigator)
in BottomTabNavigator (created by App)
in EnsureSingleNavigator
in BaseNavigationContainer
in ThemeProvider
in NavigationContainerInner (created by App)
in App
in RCTView (created by View)
in View (created by AppContainer)
in RCTView (created by View)
in View (created by AppContainer)
in AppContainer
in appUI(RootComponent), js engine: hermes

Screenshot

Screenshot 2024-04-03 at 12 28 26 PM

Expected behavior

What I want is

image

Reproduction

https://reactnavigation.org/docs/tab-based-navigation

Platform

  • Android
  • iOS
  • Web
  • Windows
  • MacOS

Packages

  • @react-navigation/bottom-tabs
  • @react-navigation/drawer
  • @react-navigation/material-top-tabs
  • @react-navigation/stack
  • @react-navigation/native-stack
  • react-native-tab-view

Environment

  • [] I've removed the packages that I don't use
package version
@react-navigation/native 6.1.17
@react-navigation/bottom-tabs 6.5.20
react-native 0.73.6
node 18.0.0
npm or yarn 10.5.0
@ayushthumar ayushthumar added the bug label Apr 3, 2024
Copy link

github-actions bot commented Apr 3, 2024

Hey @ayushthumar! Thanks for opening the issue. It seems that the issue doesn't contain a link to a repro.

The best way to get attention to your issue is to provide an easy way for a developer to reproduce the issue.

You can provide a repro using any of the following:

A snack link is preferred since it's the easiest way to both create and share a repro. If it's not possible to create a repro using a snack, link to a GitHub repo under your username is a good alternative. Don't link to a branch or specific file etc. as it won't be detected.

Try to keep the repro as small as possible by narrowing down the minimal amount of code needed to reproduce the issue. Don't link to your entire project or a project containing code unrelated to the issue. See "How to create a Minimal, Reproducible Example" for more information.

You can edit your original issue to include a link to the repro, or leave it as a comment. The issue will be closed automatically after a while if you don't provide a repro.

Copy link

github-actions bot commented Apr 3, 2024

Couldn't find version numbers for the following packages in the issue:

  • @react-navigation/native
  • @react-navigation/bottom-tabs
  • @react-navigation/drawer
  • @react-navigation/material-top-tabs
  • @react-navigation/stack
  • react-native-tab-view

Can you update the issue to include version numbers for those packages? The version numbers must match the format 1.2.3.

@Dhruv-88
Copy link

Dhruv-88 commented Apr 5, 2024

hello @ayushthumar can you share how you resolve this issue please ?

Copy link

github-actions bot commented Apr 5, 2024

Hey! This issue is closed and isn't watched by the core team. You are welcome to discuss the issue with others in this thread, but if you think this issue is still valid and needs to be tracked, please open a new issue with a repro.

@ayushthumar
Copy link
Author

ayushthumar commented Apr 5, 2024

hello @ayushthumar can you share how you resolve this issue please ?

Hello @Dhruv-88, I just deleted the build file in ios folder and then rebuild it, and also I stopped the server at port 8081 and restarted it ! Let me know if it works for you or not !

@WyattBensman
Copy link

WyattBensman commented Apr 5, 2024

I am using Expo, and I am receiving the same error with the same code you provided. Any insight on how to correct this? I saw you mentioned deleting the build file in the ios folder, where exactly is this? Any other tips?

@ayushthumar ayushthumar reopened this Apr 5, 2024
@ayushthumar
Copy link
Author

I am using Expo, and I am receiving the same error with the same code you provided. Any insight on how to correct this? I saw you mentioned deleting the build file in the ios folder, where exactly is this? Any other tips?

Screenshot 2024-04-05 at 10 34 33 AM

In your home directory there will be ios folder, go in that folder and run command rm -r build and then again run the app in simulator or your device that will automatically create new latest build file.

@ayushthumar
Copy link
Author

ayushthumar commented Apr 5, 2024

I did not found any other valid and sensible solution for this issue, I am assuming that this issue came with the new version. @brentvatne @skevy @satya164 can you please help us on this.

@netshade
Copy link
Contributor

netshade commented Apr 5, 2024

I think you may have accidentally tagged me on this issue, I'm not able to assist with this.

@WyattBensman
Copy link

I am using Expo, and I am receiving the same error with the same code you provided. Any insight on how to correct this? I saw you mentioned deleting the build file in the ios folder, where exactly is this? Any other tips?

Screenshot 2024-04-05 at 10 34 33 AM In your home directory there will be ios folder, go in that folder and run command `rm -r build` and then again run the app in simulator or your device that will automatically create new latest build file.

I sadly don't have the same file structure. I will continue to trouble shoot & hopefully find a solution.

@aminesebastian
Copy link

aminesebastian commented Apr 6, 2024

Just want to report I'm experiencing this too on Expo. I was able to resolve it by downgrading react-native-screens to 3.29.0:

npm install react-native-screens@~3.29.0

@jeremiasr
Copy link

Thanks! aminesebastian it's work!

@gulsher7
Copy link

gulsher7 commented Apr 8, 2024

same error facing . Tried all methods but now working

@Petercopter
Copy link

Petercopter commented Apr 9, 2024

Same error as OP here. Another similarity is that it's the Tabs component

  • Using Expo with file based routing
  • Navigating from sign in (root) to /(app)/(tabs)
  • Downgrading from 3.30.1 to 3.29.0 resolves the issue

@Generalchrist
Copy link

Generalchrist commented Apr 10, 2024

I'm encountering the same issue as described in this thread. However, I'm using createStackNavigator as outlined in the documentation.

While the application runs smoothly on the Android emulator, it throws the following error and gets stuck at the splash screen when launched on my iPhone 7:

ERROR Invariant Violation: requireNativeComponent: "RNSModalScreen" was not found in the UIManager.

  • I'm not using react-native-screens
  • I'm using expo so I don't have the same folder structure

EDIT: I solved it by this command:
npx expo install react-native-screens react-native-safe-area-context
I don't use these packages but somehow something needs them.

@abisalde
Copy link

Just want to report I'm experiencing this too on Expo. I was able to resolve it by downgrading react-native-screens to 3.29.0:

npm install react-native-screens@~3.29.0

This works

@protonforest
Copy link

yeah theres definetly something wrong with the last 3.30 version

@codegabk
Copy link

codegabk commented May 8, 2024

Is there a workaround without downgrading from 3.30 to 3.29 ?

@ayushthumar
Copy link
Author

Is there a workaround without downgrading from 3.30 to 3.29 ?

Till now I have not found any other way to get the work done with 3.30 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests