在 xcode 上删除了 React 本机项目,不能 运行 "run-ios react-native"

React native project deleted on xcode, can't run "run-ios react-native"

我删除了我的 React 本机项目,同时试图使 Google 地图在 Xcode 上工作,成为 .xcodeproje 和 .xcworkspace。这意味着我无法 运行 IOS 模拟器。

我试过删除 Xcode 并重新安装,但在 Xcode 上找不到 React Native 项目。尝试链接文件并创建另一个项目但没有结果。当我尝试构建模拟器时出现以下错误。已删除文件中的文件位于 ios 文件中的我的 VS Codde 中。

react-native run-ios --simulator="iPhone7"
error Could not find Xcode project files in "ios" folder. Run CLI with --verbose flag for more details.

升级您的 react-native 项目以恢复您删除的文件。

1 - 删除您的 ios 和 android 文件夹

2 - 在您的项目目录中:

react-native upgrade

3 - link 对于任何本机依赖项:

react-native link

4 - 之后:

react-native run-ios