0

我希望你能引导我朝某个方向前进,因为我完全迷路了。今天我在 vs 代码上打开了我的项目,它只是永远停留在初始化颤振上。所以我通过控制台上的flutter run启动项目。我收到此错误消息。

我还应该指出,无论我尝试运行什么项目,这个问题都仍然存在。

我尝试更改 gradle 包装器属性文件中的 gradle 版本 zip 文件,还重新下载项目的当前版本并将其粘贴到 dists /.gradle/wrapper/文件夹中,但问题仍然存在

/C:/flutter/packages/flutter_tools/lib/src/build_runner/devfs_web.dart:97:7: Error: The non-abstract class 'WebAssetServer' is missing implementations for these members:
 - AssetReader.metadataContents
Try to either
 - provide an implementation,
 - inherit an implementation from a superclass or mixin,
 - mark the class as abstract, or
 - provide a 'noSuchMethod' implementation.
 
class WebAssetServer implements AssetReader {
      ^^^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/dwds-5.1.0/lib/src/readers/asset_reader.dart:18:18: Context: 'AssetReader.metadataContents' is defined here.        
  Future<String> metadataContents(String serverPath);
                 ^^^^^^^^^^^^^^^^
/C:/flutter/packages/flutter_tools/lib/src/test/coverage_collector.dart:69:16: Error: The argument type 'Future<Map<String, Map<int, int>>>' can't be assigned to the parameter type 'Map<String, Map<int, int>>'.
 - 'Future' is from 'dart:async'.
 - 'Map' is from 'dart:core'.
    _addHitmap(coverage.createHitmap(data['coverage'] as List<Map<String, dynamic>>));
               ^
/C:/flutter/packages/flutter_tools/lib/src/test/coverage_collector.dart:101:16: Error: The argument type 'Future<Map<String, Map<int, int>>>' can't be assigned to 
the parameter type 'Map<String, Map<int, int>>'.
 - 'Future' is from 'dart:async'.
 - 'Map' is from 'dart:core'.
    _addHitmap(coverage.createHitmap(data['coverage'] as List<Map<String, dynamic>>));
               ^
Error: Unable to create dart snapshot for flutter tool.
4

1 回答 1

0

如果你已经将 Flutter 升级到最新版本,很可能你们中的一些包可能不再更新。

  • 去检查 pubspec.yaml 中的每个包,并检查是否需要更新它们中的任何一个。

  • 您还需要检查文档上是否有任何重大更改。

于 2020-09-18T14:26:14.703 回答