1

I'm on Mac OS 12 and trying to build an IOS app, but for some reason the error: Invariant Violation: requireNativeComponent: "RNSScreenStackHeaderConfig" was not found in the UIManager. doesn't seem to go away needless of what I do. Here is the Metro Output whenever I reload Metro:enter image description here

And here is my code:

import React, { useState } from 'react';
import { Text, View, Image, StyleSheet, StatusBar, ScrollView } from 'react-native';

import fetch from 'node-fetch';

import { NavigationContainer, StackActions } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';

import Main from './pages/main';

const Stack = createNativeStackNavigator();

const YourApp = () => {

    return (
        <NavigationContainer>
        
            <Stack.Navigator>
                <Stack.Screen name="Main" component={Main} />
            </Stack.Navigator>

        </NavigationContainer>
    );
}

export default YourApp;

I have been trying to solve this for the past 2 days, thanks for the help!

Neev Jewalkar
  • 45
  • 1
  • 5

2 Answers2

6

I just faced this issue 3 mins ago. I follow these steps

  • Stop metro by ctrl + c in terminal
  • npm install @react-navigation/native
  • In project directory run npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view
  • Install podfile npx pod-install ios
  • Rebuild your app npx react-native run-ios

This can help ensure that any cached data or previously installed versions of the app are completely removed, which can help resolve issues with missing components or modules.

This works for me. Hope it can help you!

wnotunas
  • 130
  • 1
  • 10
  • It also helps to uninstall the app from the device before rebuilding. – DavidP Jul 06 '23 at 06:40
  • This can help ensure that any cached data or previously installed versions of the app are completely removed, which can help resolve issues with missing components or modules. @DavidP – wnotunas Jul 06 '23 at 06:54
  • 1
    Much clearer explanation than mine, I suggest you add it to the answer, as it's also recommended by the repo owner. – DavidP Jul 06 '23 at 09:12
  • Okay, thank you! – wnotunas Jul 10 '23 at 02:02
1

Use the latest version or you can not do cheating on that