应用程序与纱线启动,但不在模拟器中工作。

问题描述 投票:0回答:1

我使用的是 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的时候,错误的命令失败,退出代码1。

如果我只是做 yarn start我认为它构建成功,因为我可以在终端上看到花和所有。然而,当我尝试使用模拟器时,它不工作。我如何解决这个问题?

ios react-native npm yarn pod
1个回答
0
投票
  1. 转到 /ios 文件夹,并运行以下命令。

    pod install && pod update
    
  2. 然后回到项目文件夹,运行下面的命令。

    rm -rf node_modules && npm install
    
  3. 接下来,清理 ios 构建文件夹。

    rm -rf ios/build
    
  4. 之后,就像往常一样运行。

    react-native run-ios
    
© www.soinside.com 2019 - 2024. All rights reserved.