![](/img/trans.png)
[英]Expo Cli - Invariant Violation: requireNativeComponent: “RNCSafeAreaProvider” was not found in the UIManager
[英]How to fix "RNCSafeAreaProvider" was not found in the UIManager Error
我升级了react-navigation
的库版本及其实用程序库。 现在,当运行应用程序时,它给了我"RNCSafeAreaProvider was not found in the UIManager Error" 。 我怎样才能解决这个问题?
当您升级react-navigation
库的版本时,可能会出现此错误,它是依赖项和链接模块。 如react-navigation 文档中所述,它由一些更核心的实用程序组成。
问题可能存在,因为,
如 React Navigation 文档中所述,尝试安装所需库的 rest。
npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view
如果您一开始没有安装这些实用程序库,则不必担心这一步。 前进到步骤 03:)
现在,如果 React-Native 应用程序在更新版本之前正在运行,而不再运行,那可能是因为 react-navigation 和其他实用程序库版本不兼容。 解决此问题的最简单方法是...
npm remove react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view
然后...
npm install react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view
这应该可以解决升级过程中引入的任何不兼容的版本问题。
由于我在 Android 构建环境中尝试了此修复...
cd android
android 文件夹并输入./gradlew clean
npx react-native run-android
再次构建应用程序。UIManager 中未找到“RNCSafeAreaProvider”错误现在应该消失了;)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.