【问题标题】:No `Podfile' found in the project directory with existing Podfile在现有 Podfile 的项目目录中找不到“Podfile\”
【发布时间】:2023-01-19 00:21:44
【问题描述】:

我正在 Flutter 和 macOS Monterey (M1) 中开发应用程序。它是为 Android 完成的,我在 IOS 中尝试。但是当我运行flutter时出现这个错误。 enter image description here

终端命令:

enter image description here

Podfile 看起来像这样:

enter image description here

【问题讨论】:

  • 你应该安装 pod
  • 尝试卸载并重新安装 cocoapods

标签: flutter macos installation cocoapods apple-m1


【解决方案1】:

打开你的 .zshrc 文件并粘贴这个

export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8

粘贴后保存并退出终端,然后重新启动编辑器,然后再次运行

【讨论】:

  • 它仍然会出现同样的问题......将语言更改为 es_ES 会警告该语言并失败,但是对于 en_US 它只会给出错误。我已经以所有可能的方式重新安装了 cocoapods,实际上问题似乎不在安装中,因为 pod init 确实有效......
  • 你重启你的IDE了吗?添加更改后?
  • 是的,IDE 和终端。更改已完成,因为 echo $LANG 获得正确的更改
  • 好吧,你实际上需要重新启动所有东西来测试它我两个月前在得到一个新的 m1 之后遇到了同样的问题,在添加上面的代码之后它没有修复,直到我在它工作之前手动重新启动所有东西
  • 仍然是问题:CocoaPods 的输出:↳ [!] No Podfile' found in the project directory. /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:161:in verify_podfile_exists!' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:46:in run' /Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:334:in run' /Library/Ruby/Gems/2.6.0/gems/ cocoapods-1.11.3/lib/cocoapods/command.rb:52:in run' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/bin/pod:55:in <top(required)>' /usr/local/bin/pod:23:in load' /usr/local/bin/pod:23:in <main>'
【解决方案2】:

你需要像这样cd进入ios目录

cd ios

如果安装了 cocoapods,则运行以下命令

pod install

如果你的机器上没有安装 cocoapods,你可以使用以下命令安装它。

sudo gem install cocoapods

我希望这可以帮助别人。

【讨论】:

    猜你喜欢
    • 2021-01-09
    • 2021-08-26
    • 2016-08-22
    • 1970-01-01
    • 1970-01-01
    • 2022-12-13
    • 2022-07-19
    • 1970-01-01
    • 2021-08-26
    相关资源
    最近更新 更多