[Solved]: Invariant Violation: requireNativeComponent: "RNSScreenStackHeaderConfig" was not found in the UIManager
![[Solved]: Invariant Violation: requireNativeComponent: "RNSScreenStackHeaderConfig" was not found in the UIManager](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fstock%2Funsplash%2Flud4OaUCP4Q%2Fupload%2Ff8f6b13266506676a5cbaa78f2aac1bb.jpeg&w=3840&q=75)
Motivated Computer Science engineering graduate from the National Institute of Technology, Srinagar with great problem-solving skills. Seeking to utilize a broad educational background with excellent technical and programming skills to thrive as a Software Engineer
The error Invariant Violation: requireNativeComponent: "RNSScreenStackHeaderConfig" was not found in the UIManager typically indicates that there is a problem with the installation or linking of the native dependencies related to React Navigation, specifically the react-native-screens package.
Here are the steps to resolve this error, especially since you are working on a Windows machine:
Ensure All Necessary Packages are Installed: Make sure you have all the necessary packages installed, including
react-native-screens.npm install @react-navigation/native @react-navigation/stack npm install react-native-screens react-native-safe-area-context
Rebuild the Project: Sometimes, a clean build can help resolve such issues. Stop the development server and run:
npx react-native run-android
If the problem still exists...
This can also be due to NDK not properly installed
Steps to Resolve the NDK Issue:
Ensure NDK is Properly Installed: Verify that the NDK is properly installed through Android Studio. You can do this by opening Android Studio and navigating to:

Download the Correct Version of NDK:
You may need to download a specific version of the NDK that is compatible with your project. To do this, you can use the SDK Manager in Android Studio:

Clean and Rebuild the Project:
First, clean your project to remove any cached build data.
Then, rebuild the project.
cd android
./gradlew clean
cd ..
npx react-native run-android
- Set NDK Version in
build.gradle:
You can specify the NDK version in your build.gradle file to ensure compatibility:
android {
...
ndkVersion '27.0.11718014' // Specify your NDK version here
}
Additional Tips
Update React Native and Dependencies: Ensure you are using the latest stable versions of React Native and related libraries.
Check Environment Variables: Ensure your
ANDROID_HOMEenvironment variable is set correctly to the Android SDK path.
By following these steps, you should be able to resolve the NDK-related build issue. If the problem persists, double-check the paths and versions to ensure everything is configured correctly.
Building a React Native app: where 'Write once, run everywhere' actually means 'Debug everywhere'๐๐๐

