1

使用 Codemagic CI,我正在尝试构建一个 Flutter Web 项目,但出现此错误:

== Building for Web ==

== /usr/local/bin/flutter packages pub global run webdev build ==
webdev could not run for this project.
You have a dependency on flutter which is not supported for flutter_web tech preview. See https://flutter.dev/web for more details.
pub finished with exit code 78

通过阅读错误信息,我以为我有一个与 Flutter Web 不兼容的依赖项,所以我删除了所有与 Web 无关的依赖项。我留下的依赖项应该适用于 Flutter Web。错误保持不变。我错过了什么吗?

pubspec.yaml:

name: bonarego_guide_module
description: A new Flutter project.

version: 1.0.0+1

environment:
  sdk: ">=2.1.0 <3.0.0"

dependencies:
  http: ^0.12.0+4
  flutter_beautiful_popup: ^1.5.0

dev_dependencies:
  build_web_compilers:
  build_runner:

flutter:
  uses-material-design: true
  assets:
    - assets/
    - assets/fonts/
    - assets/icons/
    - assets/images/
  fonts:
    - family: Comfortaa-Regular
      fonts:
        - asset: assets/fonts/Comfortaa-Regular.ttf
4

1 回答 1

1

看起来 webdev 是一个 CLI,旨在与 Flutter Web 一起使用,当时它是一个单独的存储库(现在它已合并到 Flutter 中)。我做了几处修改,但我不确定哪一个是必需的,但我认为将颤振版本设置为 Codemagic 的构建属性的主版本解决了这个问题。

于 2020-02-10T20:58:22.690 回答