Invariant Violation: RNCSafeAreaProvider was not found in the UIManager

10.6k Views Asked by At

I'm new to react native and have some experience with using regular React and am trying to get react native navigation setup but am running into the following error when following the docs. I've tried starting from scratch and reinstalling everything as I have no clue what this error means:

Invariant Violation: RNCSafeAreaProvider was not found in the UIManager any advice on how to fix this would be appreciated.

react picture

5

There are 5 best solutions below

0
Harry Redding On

for anyone who comes across this error - the way I did the installation must have been wrong as starting with a fresh project and doing the commands in this order - I did not come across the same problem:

expo init 'Project-name' cd 'Project-name' npm run android

npm install @react-navigation/native

expo install react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context @react-native-community/masked-view

npm install @react-navigation/stack

0
AudioBubble On

As an additionnal case: I went into this error when using react-navigation in an Expo Bare workflow, also following guide for react-navigation.

I simply fixed this with:

projectRoot $ cd ios
projectRoot/ios $ pod install

0
AMANi On

I recently encountered this issue. I solved it by running yarn add react-native-safe-area-context.

0
ABDULLAH On

I solved this issue by run these commands

npm install react-native-safe-area-context

pod install
0
Tibi On

I encountered a problem where my React Native app would crash on startup whenever I built the APK. After some investigation, I discovered a few steps that resolved the issue:

  1. Expo Upgrade: I executed the command expo upgrade, which updated some of the dependencies in my project. Notably, it altered the version of react-native-safe-area-context from ^4.7.4 to 4.6.3 and updated react-native to 0.72.6.
  2. I installed react-native-webview by running npm install react-native-webview. 3.I removed the node_modules directory and then reinstalled all dependencies with npm install