我使用的是 yarn run ios
在Xcode模拟器中运行一个react native项目。这在两周前还能完美地运行,但现在却不能运行了。现在,我得到了这样的错误。
error: /Users/app/ios/Pods/Target Support Files/Pods-Inst/Pods-Inst.debug.xcconfig: unable to open file (in target "Inst" in project "Inst") (in target 'Inst' from project 'Inst')
** BUILD FAILED **
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
我已经尝试过清理缓存,删除节点模块等等等等,但没有任何效果。
如果我只是做 yarn start
我认为它构建成功,因为我可以在终端上看到花和所有。然而,当我尝试使用模拟器时,它不工作。我如何解决这个问题?
转到 /ios
文件夹,并运行以下命令。
pod install && pod update
然后回到项目文件夹,运行下面的命令。
rm -rf node_modules && npm install
接下来,清理 ios
构建文件夹。
rm -rf ios/build
之后,就像往常一样运行。
react-native run-ios