Error: Method not found: 'FeatureSet.fromEnableFlags2'.

bug

Flutter 包冲突 替换了版本后一直出现此错误

flutter pub run build_runner watch --delete-conflicting-outputs
Failed to precompile build_runner:build_runner:
../../../../../.pub-cache/hosted/pub.flutter-io.cn/build_resolvers-1.4.0/lib/src/resolver.dart:437:23: Error: Method not found: 'FeatureSet.fromEnableFlags2'.
    return FeatureSet.fromEnableFlags2(
                      ^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.flutter-io.cn/build_resolvers-1.4.0/lib/src/resolver.dart:440:23: Error: Method not found: 'FeatureSet.fromEnableFlags2'.
    return FeatureSet.fromEnableFlags2(
                      ^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.flutter-io.cn/dart_style-1.3.7/lib/src/source_visitor.dart:1428:21: Error: The getter 'externalKeyword' isn't defined for the class 'FieldDeclaration'.
 - 'FieldDeclaration' is from 'package:analyzer/dart/ast/ast.dart' ('../../../../../.pub-cache/hosted/pub.flutter-io.cn/analyzer-0.39.14/lib/dart/ast/ast.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'externalKeyword'.
      modifier(node.externalKeyword);
                    ^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.flutter-io.cn/dart_style-1.3.7/lib/src/source_visitor.dart:1430:21: Error: The getter 'abstractKeyword' isn't defined for the class 'FieldDeclaration'.
 - 'FieldDeclaration' is from 'package:analyzer/dart/ast/ast.dart' ('../../../../../.pub-cache/hosted/pub.flutter-io.cn/analyzer-0.39.14/lib/dart/ast/ast.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'abstractKeyword'.
      modifier(node.abstractKeyword);
                    ^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.flutter-io.cn/dart_style-1.3.7/lib/src/source_visitor.dart:2618:21: Error: The getter 'externalKeyword' isn't defined for the class 'TopLevelVariableDeclaration'.
 - 'TopLevelVariableDeclaration' is from 'package:analyzer/dart/ast/ast.dart' ('../../../../../.pub-cache/hosted/pub.flutter-io.cn/analyzer-0.39.14/lib/dart/ast/ast.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'externalKeyword'.
      modifier(node.externalKeyword);
                    ^^^^^^^^^^^^^^^
pub finished with exit code 1

未找到原因

临时解决办法

生成一个子项目把要生成的源文件(bean等)和库放进去 跑完再放回去

你可能感兴趣的:(Error: Method not found: 'FeatureSet.fromEnableFlags2'.)