React native 如何使用pod完全删除React本机库?
我正在尝试从react-native项目中删除React native 如何使用pod完全删除React本机库?,react-native,cocoapods,React Native,Cocoapods,我正在尝试从react-native项目中删除react-native设备信息(支持较小的react-native版本号) 我采取了以下步骤: 纱线移除反应本机设备信息 cd ios和pod安装 清理构建并清除看守员/打包机缓存 删除并重新创建JS包 grep以获取整个项目目录(包括节点模块)中反应本机设备信息的任何引用(未找到) 但是,当我运行应用程序时,仍然会出现这些错误。我错过了什么 [Thu Jul 23 2020 14:20:30.622] ERROR Error: @reac
react-native设备信息
(支持较小的react-native版本号
)
我采取了以下步骤:
[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)
[Thu Jul 23 2020 14:20:30.622]错误:@react native community/react native device info:NativeModule.RNDeviceInfo为空。要解决此问题,请尝试以下步骤:
•对于react-nativereact-native取消react-native设备信息的链接
您还需要从代码库中删除react native device info
,您可能仍将其导入到某个文件中。另外,在删除pod时,请记住重新安装应用程序并重新启动捆绑程序。在当前版本的react native中,只需从package.json中删除依赖项并运行pod安装
即可。不需要手动取消链接
我们在package.json中添加了一个Thread postinstall脚本,以便始终运行pod安装:
“postinstall”:“(cd ios和pod安装)”,
作为最后一种选择,重新启动你的计算机,哈哈哈,实际上,重新启动一切都可以做到这一点。当我今天早上开始工作的时候,它正在工作。有点古怪。还注意到我添加的一些代码(console.log)不起作用,因此这是另一个关于发生了什么的线索。这可能与.git/index.lock
文件有关。然后,我过去遇到过这种情况,我的代码中没有任何内容在更新。也许这可以帮助您检查您的pod文件
中的特定pod了吗?