4

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

Ali Bigdeli
  • 1,286
  • 3
  • 17
  • 35
Harry Redding
  • 61
  • 1
  • 3
  • Are you using Expo React-Native? Just follow the installation guide for React Navigation. I think something failed there. https://reactnavigation.org/docs/getting-started#installation – Arbnor Sep 07 '20 at 15:17
  • The order I followed was in your link: - 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 – Harry Redding Sep 07 '20 at 15:37
  • Can you remove the import of react-native-gesture-handler and try again please? – Arbnor Sep 07 '20 at 15:41
  • Hi, I removed import 'react-native-gesture-handler from the top but am still encountering the same probem. (RNCSafeAreaProvider was not found in the UIManager) – Harry Redding Sep 07 '20 at 15:53

4 Answers4

4

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

AMANi
  • 43
  • 5
2

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

Harry Redding
  • 61
  • 1
  • 3
2

I solved this issue by run these commands

npm install react-native-safe-area-context

pod install
ABDULLAH
  • 550
  • 3
  • 13
0

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