更新本机反应后反应本机 iOS 构建错误

时间:2021-07-24 17:43:42

标签: ios react-native

更新本机版本后,在尝试 npm run ios 时遇到一些问题。

<块引用>

这是我遇到的问题:

enter image description here

enter image description here

<块引用>

我尝试过的:

我已经安装了 cocoapods,完成了 pod deintegrate,完成了 pod update 我也已经完成了 pod repo update。我尝试删除并重新安装 node_modules。但错误是一样的。

在运行 pod install 时,我得到了这个: enter image description here

react native doctor 的输出:

enter image description here

这是我在 xcode 中运行时所拥有的:

enter image description here enter image description here enter image description here enter image description here

反应本机信息 enter image description here

pod 文件的内容: enter image description here

2 个答案:

答案 0 :(得分:1)

升级到新的 RN 版本有时会非常棘手。一个简单的方法是使用这个 helper。在点击“告诉我如何升级!”之前,您将旧的(当前)版本号放入帮助程序网站的左侧文本框中,然后还将您想要升级到的新版本放入右侧的文本框中。按钮。

因此,在您的情况下,我建议您使用此帮助程序作为特定场景的指南,使用旧版本和给您错误的新版本。单击该按钮后,它将准确显示您需要进行哪些更改才能成功构建项目。然后您可以将您已经尝试过的内容与指南进行比较,也许您错过了某些地方。

答案 1 :(得分:0)

这是你需要做的

  1. cd ios

  2. pod install --repo-updatepod repo update

  3. pod install

或者用一个 cmd 来简化它,你可以使用 npx pod-install repo update && npx pod-install

pod 安装应该会成功运行。这发生在我安装软件包并运行 npx pod-install

我刚刚在上述步骤之一解决了我的问题的项目中遇到了这个错误。试试这个,如果有任何问题,请告诉我。