繁体   English   中英

如何修复“RNCSafeAreaProvider”在 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 文档中所述,它由一些更核心的实用程序组成。

问题可能存在,因为,

  1. 一些需要的库没有安装。
  2. 这些连接的模块的库版本相互不兼容(可能在手动升级库时)
  3. 需要干净的重建

步骤 01 - 安装实用程序库。

如 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

STEP 02 - 修复不兼容的版本

如果您一开始没有安装这些实用程序库,则不必担心这一步。 前进到步骤 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

这应该可以解决升级过程中引入的任何不兼容的版本问题。

STEP 03 - 再次构建应用程序

由于我在 Android 构建环境中尝试了此修复...

  1. 卸载应用程序。
  2. cd android android 文件夹并输入./gradlew clean
  3. npx react-native run-android再次构建应用程序。

UIManager 中未找到“RNCSafeAreaProvider”错误现在应该消失了;)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM