2
votes

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

3
Are you using Expo React-Native? Just follow the installation guide for React Navigation. I think something failed there. reactnavigation.org/docs/getting-started#installation - Arbnor
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
Can you remove the import of react-native-gesture-handler and try again please? - Arbnor
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

3 Answers

2
votes

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
votes

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
votes

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