Invariant Violation: requireNativeComponent: "RNCSafeAreaProvider" was not found in the UIManager.


I would like to know why this error “Invariant Violation: requireNativeComponent: “RNCSafeAreaProvider” was not found in the UIManager.” appears when I launch the development of my app with the dev client ( npx expo start --dev-client). the app works fine on Expo Go with the npx expo start command.

here are the installed dependencies:
“dependencies”: {
@expo-google-fonts/poppins”: “^0.2.3”,
@react-native-async-storage/async-storage”: “1.17.11”,
@react-native-community/masked-view”: “^0.1.11”,
@react-native-masked-view/masked-view”: “0.2.8”,
@react-native-material/core”: “^1.3.7”,
@react-navigation/bottom-tabs”: “^6.5.7”,
@react-navigation/material-bottom-tabs”: “^6.2.15”,
@react-navigation/native”: “^6.1.7”,
@react-navigation/native-stack”: “^6.9.12”,
@react-navigation/stack”: “^6.3.16”,
“expo”: “~48.0.11”,
“expo-app-loading”: “^2.1.1”,
“expo-av”: “~13.2.1”,
“expo-dev-client”: “~2.2.1”,
“expo-font”: “~11.1.1”,
“expo-status-bar”: “~1.4.4”,
“expo-svg-uri”: “^1.3.1”,
“moti”: “^0.25.3”,
“nativewind”: “^2.0.11”,
“react”: “18.2.0”,
“react-native”: “0.71.8”,
“react-native-gesture-handler”: “^2.12.0”,
“react-native-paper”: “^5.7.0”,
“react-native-reanimated”: “~2.14.4”,
“react-native-safe-area-context”: “^4.6.3”,
“react-native-screens”: “^3.22.0”,
“react-native-sound”: “^0.11.2”,
“react-native-svg”: “13.4.0”,
“react-native-vector-icons”: “^9.2.0”,
“styled-components”: “^5.3.10”

Do you know what could be causing the problem? Thank you.

Hi @lens221

Expo Go has the whole of the Expo SDK and any dependencies that needs built in.

It seems you are missing react-native-safe-area-context

You might get this if you are using React Navigation but did not install the peer dependencies:

Thank you for your reply
react-native-safe-area-context is install but the error still shows, the problem is as i said only shows in dev client not in expo go


Then do you have an android directory or an ios directory in your app?

If so, you probably ran npx expo prebuild or npx expo run:android or npx expo run:ios at some point. Those commands cause the native android / ios projects to be generated which basically switches you to the Bare workflow.

If the app works correctly in Expo Go, you don’t need the android and ios directories and should remove them, as long as you have not made any changes in them that you still want.

Secondly, whether or not you had the above mentioned android or ios directories, did you create a new development build after installing react-native-safe-area-context?

react-native-safe-area-context includes native code, so if you install it you need to rebuild your app so that it includes that native code. Otherwise when the JavaScript tries to call it it will not find it in your app and you will get an error like this.

Thank you, your solution works

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.