在颤振上运行构建运行程序时,出现以下错误
Posted
技术标签:
【中文标题】在颤振上运行构建运行程序时,出现以下错误【英文标题】:When running build runner on flutter I get the following error 【发布时间】:2021-04-22 14:46:00 【问题描述】:当我跑步时
flutter packages pub run build_runner build --delete-conflicting-outputs
我收到以下错误。
Failed to precompile build_runner:build_runner:
../../snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.40.6/lib/error/error.dart:7:8: Error: Error when reading '../../snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/_fe_analyzer_shared-12.0.0/lib/src/base/errors.dart': No such file or directory
import 'package:_fe_analyzer_shared/src/base/errors.dart';
【问题讨论】:
试试flutter pub cache repair
、flutter clean
、flutter pub upgrade
。
舒克兰,哈米德。它奏效了。
【参考方案1】:
运行以下命令:
flutter pub cache repair
flutter clean
flutter pub upgrade
【讨论】:
以上是关于在颤振上运行构建运行程序时,出现以下错误的主要内容,如果未能解决你的问题,请参考以下文章