1

build_runner ビルド コマンドを実行しようとしています。

$ flutter packages pub run build_runner build --delete-conflicting-outputs

しかし、次のエラーが発生します。

C:\tools\flutter\bin\flutter.bat packages pub run build_runner build --delete-conflicting-outputs
[INFO] Generating build script...
[INFO] Generating build script completed, took 703ms

[INFO] Creating build script snapshot......
[INFO] Creating build script snapshot... completed, took 28.8s

[SEVERE] Failed to snapshot build script .dart_tool/build/entrypoint/build.dart.
This is likely caused by a misconfigured builder definition.
[SEVERE] /C:/tools/flutter/packages/flutter/lib/src/material/animated_icons.dart:9:8: Error: Not found: 'dart:ui'import 'dart:ui' as ui show Paint, Path, Canvas;       ^/C:/tools/flutter/packages/flutter/lib/src/material/animated_icons.dart:10:8: Error: Not found: 'dart:ui'import 'dart:ui' show lerpDouble;       ^/C:/tools/flutter/packages/flutter/lib/src/material/app.dart:5:8: Error: Not found: 'dart:ui'import 'dart:ui' as ui;       ^/C:/tools/flutter/packages/flutter/lib/src/material/app_bar_theme.dart:5:8: Error: Not found: 'dart:ui'import 'dart:ui' show lerpDouble;       ^/C:/tools/flutter/packages/flutter/lib/src/material/arc.dart:6:8: Error: Not found: 'dart:ui'import 'dart:ui' show lerpDouble;       ^/C:/tools/flutter/packages/flutter/lib/src/material/bottom_app_bar_theme.dart:5:8: Error: Not found: 'dart:ui'import 'dart:ui' show lerpDouble;       ^/C:/tools/flutter/packages/flutter/lib/src/material/bottom_sheet.dart:6:8: Error: Not found: 'dart:ui'import 'dart:ui' show lerpDouble;       ^/C:/tools/flutter/packages/flutter/lib/src/material/bottom_sheet_theme.dart:5:8: Error: Not found: 'dart:ui'import 'dart:ui' show lerpDouble;       ^/C:/tools/flutter/packages/flutter/lib/src/material/button_bar_theme.dart:5:8: Error: Not found: 'dart:ui'import 'dart:ui' show lerpDouble;       ^/C:/tools/flutter/packages/flutter/lib/src/material/card_theme.dart:5:8: Error: Not found: 'dart:ui'import 'dart:ui' show lerpDouble;       ^
pub finished with exit code 78

Process finished with exit code 78

問題のイメージ

更新 2020-07-25:

私はすでに を実行しようとしflutter cleanflutter pub getpubspec.yaml をさまざまな方法で、さまざまな依存関係バージョンのさまざまな組み合わせで変更しようとしましたが、問題は引き続き発生します。

非常によく似た問題を提示する問題を見つけましたが、テストのコンテキストでは、これは私の場合ではありません。

問題を特定しやすくするために、pubspec.yaml を投稿します。

name: schema_widget
description: A Flutter package for dynamic widget creation.
version: 0.1.11
homepage: https://github.com/Legytma/schema_widget

environment:
  sdk: ">=2.1.0 <3.0.0"

legytma_schema:
  version: 1.1.2

dependencies:
  flutter:
    sdk: flutter
  logging: ^0.11.4
  get_it: ^4.0.4
  json_schema: ^2.2.1
  http: ^0.12.2
  google_maps_flutter: ^0.5.28+1
  flutter_spinkit: ^4.1.2+1
  build: ^1.3.0
  source_gen: ^0.9.6
  path_provider: ^1.6.11
  flutter_cache_manager: ^1.4.1
  rxdart:
  analyzer:
  glob:
  path:

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_driver:
    sdk: flutter
  effective_dart: ^1.2.4
  build_test: '>=1.0.0'
  build_runner: ^1.10.0
  dependency_validator: ^1.5.0

flutter:
  uses-material-design: true

  assets:
    - assets/
    - assets/LegytmaSchemas/schema/
    - assets/LegytmaSchemas/schema/widget/
4

1 に答える 1

3

私は同じ問題を抱えていて、ジェネレーターファイルに誤ってフラッターパッケージをインポートしたことがわかりました。無駄なインポートを削除すると、問題が修正されました。

于 2020-12-09T11:08:16.737 に答える