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

4
  • 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
    Commented Sep 7, 2020 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 Commented Sep 7, 2020 at 15:37
  • Can you remove the import of react-native-gesture-handler and try again please?
    – Arbnor
    Commented Sep 7, 2020 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) Commented Sep 7, 2020 at 15:53

5 Answers 5

4

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

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

2

I solved this issue by run these commands

npm install react-native-safe-area-context

pod install
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

0

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.