【问题标题】:Flutter Desktop Podfile Missing (flutter run -d macOS)Flutter 桌面 Podfile 丢失(flutter run -d macOS)
【发布时间】:2020-04-24 17:19:47
【问题描述】:

flutter run -d macOS

Downloading darwin-x64 tools...                                   107.0s
Downloading darwin-x64-profile tools...                            69.7s
Downloading darwin-x64-profile tools...                            23.6s
Downloading darwin-x64-release tools...                            54.3s
Downloading darwin-x64-release tools...                            20.4s

在 macOS 上以调试模式启动 lib/main.dart... 缺少 Pod 文件


当我运行 flutter run -d macOS 代码时,它显示 Podfile 丢失以及如何修复它?
Mac Pro
如何使用 android studio 运行 mac 桌面应用程序?
如果无法从 android studio 运行 macOS 应用程序,那么我需要使用哪个 ide?​​p>

【问题讨论】:

  • 你的项目中是否有一个名为macOS的目录?
  • 否,没有名为 macOS 的文件夹
  • 试试这个:flutter config --enable-macos-desktop,然后在你的项目根目录中:flutter create .
  • 另外你必须在master频道。
  • 我已经准备好运行flutter config --enable-macos-desktop,它不是一个新项目,它是android应用程序的一个旧项目

标签: macos flutter flutter-dependencies podfile flutter-desktop


【解决方案1】:

当您选择了命令行工具时,也可能会出现Podfile missing 消息。在这种情况下,它可以修复

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

当我切换到 Flutter 2.0 时,这为我解决了这个问题。 我之前也跑过flutter create --platforms=macos .,但这并没有解决问题。

【讨论】:

    【解决方案2】:

    为现有的 Flutter 项目添加桌面支持 要为现有项目添加桌面支持,请从项目根目录在终端中运行以下命令:

    颤振创建。

    要将您的项目作为桌面应用程序运行,请使用以下命令:

    flutter run -d macOS
    for more

    【讨论】:

      猜你喜欢
      • 2021-05-28
      • 2018-08-30
      • 2021-07-27
      • 2019-03-20
      • 2017-12-01
      • 2020-08-02
      • 2022-11-21
      • 2020-02-26
      • 1970-01-01
      相关资源
      最近更新 更多