首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >我怎么才能用吊舱完全移除反应本机库呢?

我怎么才能用吊舱完全移除反应本机库呢?
EN

Stack Overflow用户
提问于 2020-07-23 19:24:06
回答 2查看 4.8K关注 0票数 3

我正在尝试将react-native-device-info从中删除(以支持较小的react-native-version-number)。

我已经采取了以下步骤:

删除react-native-device-info

  • cd ios & pod &pod

  • 清洁构建并清除/packager缓存
  1. 删除,并重新创建JS bundle
  2. grep,以便在整个项目目录(包括节点-模块(无找到)

g 213)中响应-本机-设备-信息

然而,当我运行这个应用程序时,我仍然会看到这些错误。我遗漏了什么?

代码语言:javascript
复制
[Thu Jul 23 2020 14:20:30.622]  ERROR    Error: @react-native-community/react-native-device-info: NativeModule.RNDeviceInfo is null. To fix this issue try these steps:
  • For react-native <= 0.59: Run `react-native link react-native-device-info` in the project root.
  • Rebuild and re-run the app.
  • If you are using CocoaPods on iOS, run `pod install` in the `ios` directory and then rebuild and re-run the app. You may also need to re-open Xcode to get the new pods.
  If none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-community/react-native-device-info
[Thu Jul 23 2020 14:20:30.623]  ERROR    Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)
[Thu Jul 23 2020 14:20:31.746]  ERROR    Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication)

EN

回答 2

Stack Overflow用户

发布于 2020-09-21 16:24:05

在react本机的当前版本中,只需从package.json中移除依赖项并运行pod install即可。不需要手动断开连接。

我们还在package.json中添加了一个纱线后安装脚本,以便始终运行postinstall:

"postinstall": "(cd ios && pod install)",

票数 3
EN

Stack Overflow用户

发布于 2020-07-23 20:41:18

react-native unlink react-native-device-info

您还需要从代码库中删除react-native-device-info,可能还会在某个文件中导入它。另外,当移除豆荚时,请记住重新安装应用程序并重新启动绑定程序。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63061724

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档