Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flutter pub run build_runner build报错 #235

Open
git-maven opened this issue Mar 3, 2023 · 6 comments
Open

flutter pub run build_runner build报错 #235

git-maven opened this issue Mar 3, 2023 · 6 comments

Comments

@git-maven
Copy link

../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2dsl-1.1.0/lib/fairdsl/fair_ast_gen.dart:200:22: Error: Type 'TypeName' not found.
Map? visitTypeName(TypeName node) {
^^^^^^^^
../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2dsl-1.1.0/lib/fairdsl/fair_ast_gen.dart:125:25: Error: The argument type 'Token' can't be assigned to the parameter type 'AstNode?'.

  • 'Token' is from 'package:_fe_analyzer_shared/src/scanner/token.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/_fe_analyzer_shared-55.0.0/lib/src/scanner/token.dart').
  • 'AstNode' is from 'package:analyzer/dart/ast/ast.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/analyzer-5.7.1/lib/dart/ast/ast.dart').
    _visitNode(node.name), _visitNode(node.initializer));
    ^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2dsl-1.1.0/lib/fairdsl/fair_ast_gen.dart:167:25: Error: The argument type 'Token' can't be assigned to the parameter type 'AstNode?'.
  • 'Token' is from 'package:_fe_analyzer_shared/src/scanner/token.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/_fe_analyzer_shared-55.0.0/lib/src/scanner/token.dart').
  • 'AstNode' is from 'package:analyzer/dart/ast/ast.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/analyzer-5.7.1/lib/dart/ast/ast.dart').
    _visitNode(node.name), _visitNode(node.functionExpression));
    ^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2dsl-1.1.0/lib/fairdsl/fair_ast_gen.dart:191:37: Error: The getter 'identifier' isn't defined for the class 'SimpleFormalParameter'.
  • 'SimpleFormalParameter' is from 'package:analyzer/dart/ast/ast.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/analyzer-5.7.1/lib/dart/ast/ast.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'identifier'.
    _visitNode(node.type), node.identifier?.name);
    ^^^^^^^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2dsl-1.1.0/lib/fairdsl/fair_ast_gen.dart:200:22: Error: 'TypeName' isn't a type.
    Map? visitTypeName(TypeName node) {
    ^^^^^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2dsl-1.1.0/lib/fairdsl/fair_ast_gen.dart:212:25: Error: The argument type 'Token' can't be assigned to the parameter type 'AstNode?'.
  • 'Token' is from 'package:_fe_analyzer_shared/src/scanner/token.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/_fe_analyzer_shared-55.0.0/lib/src/scanner/token.dart').
  • 'AstNode' is from 'package:analyzer/dart/ast/ast.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/analyzer-5.7.1/lib/dart/ast/ast.dart').
    _visitNode(node.name),
    ^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2dsl-1.1.0/lib/fairdsl/fair_ast_gen.dart:254:25: Error: The argument type 'Token' can't be assigned to the parameter type 'AstNode?'.
  • 'Token' is from 'package:_fe_analyzer_shared/src/scanner/token.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/_fe_analyzer_shared-55.0.0/lib/src/scanner/token.dart').
  • 'AstNode' is from 'package:analyzer/dart/ast/ast.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/analyzer-5.7.1/lib/dart/ast/ast.dart').
    _visitNode(node.name),
    ^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2dsl-1.1.0/lib/fairdsl/fair_ast_gen.dart:510:72: Error: Member not found: 'FeatureSet.fromEnableFlags'.
    var parseResult = parseFile(path: path, featureSet: FeatureSet.fromEnableFlags([]));
    ^^^^^^^^^^^^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2dsl-1.1.0/lib/src/widget.dart:332:51: Error: The getter 'exports' isn't defined for the class 'LibraryOrAugmentationElement'.
  • 'LibraryOrAugmentationElement' is from 'package:analyzer/dart/element/element.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/analyzer-5.7.1/lib/dart/element/element.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'exports'.
    var exports = result.element.enclosingElement.exports;
    ^^^^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2dsl-1.1.0/lib/src/widget.dart:662:30: Error: The getter 'types' isn't defined for the class 'CompilationUnitElement'.
  • 'CompilationUnitElement' is from 'package:analyzer/dart/element/element.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/analyzer-5.7.1/lib/dart/element/element.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'types'.
    var apis = [...unitElement.types, ...unitElement.enums];
    ^^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2js-1.3.2/lib/src/covert/convertClassString.dart:8:56: Error: Member not found: 'FeatureSet.fromEnableFlags'.
    parseString(content: content, featureSet: FeatureSet.fromEnableFlags([]));
    ^^^^^^^^^^^^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2js-1.3.2/lib/src/covert/convertArrayFuncExpression.dart:13:40: Error: The getter 'identifier' isn't defined for the class 'FormalParameter'.
  • 'FormalParameter' is from 'package:analyzer/dart/ast/ast.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/analyzer-5.7.1/lib/dart/ast/ast.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'identifier'.
    gnNode.argumentList.add([element.identifier.toString()]);
    ^^^^^^^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2js-1.3.2/lib/src/covert/convertWidgetStateFile.dart:51:51: Error: Member not found: 'FeatureSet.fromEnableFlags'.
    path: stateFilePath, featureSet: FeatureSet.fromEnableFlags([]));
    ^^^^^^^^^^^^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2js-1.3.2/lib/src/visitor/ClassDeclarationVisitor.dart:28:48: Error: The getter 'name' isn't defined for the class 'Token'.
  • 'Token' is from 'package:_fe_analyzer_shared/src/scanner/token.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/_fe_analyzer_shared-55.0.0/lib/src/scanner/token.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'name'.
    classDeclarationData.className = node.name.name;
    ^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2js-1.3.2/lib/src/visitor/ClassDeclarationVisitor.dart:44:72: Error: The getter 'name' isn't defined for the class 'Token'.
  • 'Token' is from 'package:_fe_analyzer_shared/src/scanner/token.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/_fe_analyzer_shared-55.0.0/lib/src/scanner/token.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'name'.
    if (isDataBean && ['fromJson', 'toJson'].contains(element.name.name)) {
    ^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2js-1.3.2/lib/src/visitor/ClassDeclarationVisitor.dart:54:51: Error: The getter 'name' isn't defined for the class 'Token'.
  • 'Token' is from 'package:_fe_analyzer_shared/src/scanner/token.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/_fe_analyzer_shared-55.0.0/lib/src/scanner/token.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'name'.
    if (!excludeMethods.contains(element.name.name)) {
    ^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2js-1.3.2/lib/src/visitor/ClassDeclarationVisitor.dart:56:28: Error: The getter 'name' isn't defined for the class 'Token'.
  • 'Token' is from 'package:_fe_analyzer_shared/src/scanner/token.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/_fe_analyzer_shared-55.0.0/lib/src/scanner/token.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'name'.
    element.name.name,
    ^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2js-1.3.2/lib/src/visitor/ClassDeclarationVisitor.dart:57:64: Error: The getter 'name' isn't defined for the class 'Token'.
  • 'Token' is from 'package:_fe_analyzer_shared/src/scanner/token.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/_fe_analyzer_shared-55.0.0/lib/src/scanner/token.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'name'.
    '${element.returnType.toString()} ${element.name.name}${element.parameters.toString()}${element.body.toString()}',
    ^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2js-1.3.2/lib/src/visitor/ClassDeclarationVisitor.dart:63:73: Error: The getter 'name' isn't defined for the class 'Token'.
  • 'Token' is from 'package:_fe_analyzer_shared/src/scanner/token.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/_fe_analyzer_shared-55.0.0/lib/src/scanner/token.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'name'.
    if (isDataBean && ['fromJson', 'toJson'].contains(element.name?.name)) {
    ^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2js-1.3.2/lib/src/visitor/ClassDeclarationVisitor.dart:74:27: Error: The getter 'name' isn't defined for the class 'Token'.
  • 'Token' is from 'package:_fe_analyzer_shared/src/scanner/token.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/_fe_analyzer_shared-55.0.0/lib/src/scanner/token.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'name'.
    element.name?.name ?? constructorAlias,
    ^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2js-1.3.2/lib/src/visitor/ClassDeclarationVisitor.dart:81:31: Error: The getter 'name' isn't defined for the class 'Token'.
  • 'Token' is from 'package:_fe_analyzer_shared/src/scanner/token.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/_fe_analyzer_shared-55.0.0/lib/src/scanner/token.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'name'.
    : element.name!.name;
    ^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2js-1.3.2/lib/src/visitor/ClassDeclarationVisitor.dart:94:52: Error: The getter 'identifier' isn't defined for the class 'NormalFormalParameter'.
  • 'NormalFormalParameter' is from 'package:analyzer/dart/ast/ast.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/analyzer-5.7.1/lib/dart/ast/ast.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'identifier'.
    var newParamName = element.parameter.identifier.toString();
    ^^^^^^^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2js-1.3.2/lib/src/visitor/ClassDeclarationVisitor.dart:147:28: Error: The getter 'name' isn't defined for the class 'Token'.
  • 'Token' is from 'package:_fe_analyzer_shared/src/scanner/token.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/_fe_analyzer_shared-55.0.0/lib/src/scanner/token.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'name'.
    element.name.name.trim(),
    ^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2js-1.3.2/lib/src/visitor/ClassDeclarationVisitor.dart:153:28: Error: The getter 'name' isn't defined for the class 'Token'.
  • 'Token' is from 'package:_fe_analyzer_shared/src/scanner/token.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/_fe_analyzer_shared-55.0.0/lib/src/scanner/token.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'name'.
    element.name.name.trim(),
    ^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2js-1.3.2/lib/src/visitor/ClassDeclarationVisitor.dart:169:28: Error: The getter 'name' isn't defined for the class 'Token'.
  • 'Token' is from 'package:_fe_analyzer_shared/src/scanner/token.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/_fe_analyzer_shared-55.0.0/lib/src/scanner/token.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'name'.
    element.name.name, generator.func?.body.toSource())
    ^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2js-1.3.2/lib/src/visitor/ClassDeclarationVisitor.dart:186:32: Error: Member not found: 'FeatureSet.fromEnableFlags'.
    featureSet: FeatureSet.fromEnableFlags([]));
    ^^^^^^^^^^^^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2js-1.3.2/lib/src/visitor/SimpleFunctionGenerator.dart:44:25: Error: The getter 'identifier' isn't defined for the class 'FormalParameter'.
  • 'FormalParameter' is from 'package:analyzer/dart/ast/ast.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/analyzer-5.7.1/lib/dart/ast/ast.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'identifier'.
    var ident = param.identifier.toString();
    ^^^^^^^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2js-1.3.2/lib/src/visitor/WidgetStateGenerator.dart:115:64: Error: 'TypeName' isn't a type.
    ((member as MethodDeclaration).returnType as TypeName)
    ^^^^^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2js-1.3.2/lib/src/visitor/WidgetStateGenerator.dart:84:48: Error: The getter 'name' isn't defined for the class 'Token'.
  • 'Token' is from 'package:_fe_analyzer_shared/src/scanner/token.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/_fe_analyzer_shared-55.0.0/lib/src/scanner/token.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'name'.
    tempClassDeclaration.className = node.name.name;
    ^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2js-1.3.2/lib/src/visitor/WidgetStateGenerator.dart:134:56: Error: The getter 'name' isn't defined for the class 'Token'.
  • 'Token' is from 'package:_fe_analyzer_shared/src/scanner/token.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/_fe_analyzer_shared-55.0.0/lib/src/scanner/token.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'name'.
    classDeclarationData.className = node.name.name;
    ^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2js-1.3.2/lib/src/visitor/handle/handleForStatement.dart:45:35: Error: The getter 'identifier' isn't defined for the class 'DeclaredIdentifier'.
  • 'DeclaredIdentifier' is from 'package:analyzer/dart/ast/ast.dart' ('../../../.pub-cache/hosted/pub.flutter-io.cn/analyzer-5.7.1/lib/dart/ast/ast.dart').
    Try correcting the name to the name of an existing getter, or defining a getter or field named 'identifier'.
    forLoopParts.loopVariable.identifier.toString();
    ^^^^^^^^^^
    ../../../.pub-cache/hosted/pub.flutter-io.cn/fair_dart2js-1.3.2/lib/src/visitor/PartJsCodeGenerator.dart:35:32: Error: Member not found: 'FeatureSet.fromEnableFlags'.
    featureSet: FeatureSet.fromEnableFlags([]));
    ^^^^^^^^^^^^^^^

在执行dart pub run build_runner build报错
项目里接入了objectbox
目前分析确认应该是这三个库的版本导致的问题
analyzer: ^5.7.1
dart_style: ^2.2.5
build_resolvers: ^2.2.0
source_gen: ^1.2.7

可能需要你们升级一下
dart sdk 2.19.0
flutter sdk 3.3.8

@git-maven
Copy link
Author

This requires the 'super-parameters' language feature to be enabled.

这边运行flutter pub run build_runner build后会提示这个, 应该是dart的版本问题
image

@yancechen
Copy link
Contributor

收到,我们正在排查中。

@git-maven
Copy link
Author

你好, 请问现在微信群是不运营了嘛, 加了你们留下的二维码, 一直没有通过

@yancechen
Copy link
Contributor

麻烦你再发一个申请,我给小秘书说一下。

@git-maven
Copy link
Author

麻烦你再发一个申请,我给小秘书说一下。

你好, 已经发送了, 备注了Fair

@yancechen
Copy link
Contributor

yancechen commented Mar 8, 2023

今天小秘书好像请假了,你先加我微信吧,我拉你进去:Youyutx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants