You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
flutter pub run build_runner build --delete-conflicting-outputs
I ran the above cmd to generate .g file 1 months ago, but now it reporting this error message.
Try to do flutter clean and pub get again, but it doesn't resolve the issue.
Can anyone help me to fix this issue?
Thanks
`[INFO] Generating build script completed, took 351ms
[WARNING] /Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/serializer_source_library.dart:125:43: Error: The getter 'element' isn't defined for the class 'DartType'.
'DartType' is from 'package:analyzer/dart/element/type.dart' ('/Users/calvin/.pub-cache/hosted/pub.dartlang.org/analyzer-5.1.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
SerializerSourceClass(type!.element as InterfaceElement)));
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/dart_types.dart:26:31: Error: The getter 'element' isn't defined for the class 'DartType'.
'DartType' is from 'package:analyzer/dart/element/type.dart' ('/Users/calvin/.pub-cache/hosted/pub.dartlang.org/analyzer-5.1.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
ValueSourceClass(type.element as ClassElement).settings.instantiable;
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/dart_types.dart:31:12: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
'InterfaceType' is from 'package:analyzer/dart/element/type.dart' ('/Users/calvin/.pub-cache/hosted/pub.dartlang.org/analyzer-5.1.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
type.element.allSupertypes
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/dart_types.dart:75:25: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
'InterfaceType' is from 'package:analyzer/dart/element/type.dart' ('/Users/calvin/.pub-cache/hosted/pub.dartlang.org/analyzer-5.1.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
return dartType.element.name + suffix;
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/dart_types.dart:80:28: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
'InterfaceType' is from 'package:analyzer/dart/element/type.dart' ('/Users/calvin/.pub-cache/hosted/pub.dartlang.org/analyzer-5.1.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
return '${dartType.element.name}<$typeArgumentsStr>$suffix';
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/dart_types.dart:83:23: Error: The getter 'element' isn't defined for the class 'TypeParameterType'.
'TypeParameterType' is from 'package:analyzer/dart/element/type.dart' ('/Users/calvin/.pub-cache/hosted/pub.dartlang.org/analyzer-5.1.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
return dartType.element.name + suffix;
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/value_source_class.dart:78:45: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
'InterfaceType' is from 'package:analyzer/dart/element/type.dart' ('/Users/calvin/.pub-cache/hosted/pub.dartlang.org/analyzer-5.1.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
.any((interfaceType) => interfaceType.element.name == 'Built');
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/value_source_class.dart:96:29: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
'InterfaceType' is from 'package:analyzer/dart/element/type.dart' ('/Users/calvin/.pub-cache/hosted/pub.dartlang.org/analyzer-5.1.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
...element.supertype!.element.allSupertypes
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/value_source_class.dart:219:49: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
'InterfaceType' is from 'package:analyzer/dart/element/type.dart' ('/Users/calvin/.pub-cache/hosted/pub.dartlang.org/analyzer-5.1.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
.where((interfaceType) => interfaceType.element.name == 'Builder')
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/value_source_class.dart:319:57: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
'InterfaceType' is from 'package:analyzer/dart/element/type.dart' ('/Users/calvin/.pub-cache/hosted/pub.dartlang.org/analyzer-5.1.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
.where((interface) => needsBuiltValue(interface.element))
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/value_source_class.dart:328:55: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
'InterfaceType' is from 'package:analyzer/dart/element/type.dart' ('/Users/calvin/.pub-cache/hosted/pub.dartlang.org/analyzer-5.1.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
.where((interface) => needsBuiltValue(interface.element))
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/value_source_class.dart:367:24: Error: The getter 'enclosingElement' isn't defined for the class 'MethodElement'.
'MethodElement' is from 'package:analyzer/dart/element/element.dart' ('/Users/calvin/.pub-cache/hosted/pub.dartlang.org/analyzer-5.1.0/lib/dart/element/element.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'enclosingElement'.
var clazz = method.enclosingElement;
^^^^^^^^^^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/value_source_class.dart:379:50: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
'InterfaceType' is from 'package:analyzer/dart/element/type.dart' ('/Users/calvin/.pub-cache/hosted/pub.dartlang.org/analyzer-5.1.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
(interfaceType) => interfaceType.element.name == 'Built') ||
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/value_source_class.dart:1080:48: Error: The getter 'element' isn't defined for the class 'DartType'.
'DartType' is from 'package:analyzer/dart/element/type.dart' ('/Users/calvin/.pub-cache/hosted/pub.dartlang.org/analyzer-5.1.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
field.element.getter!.returnType.element!.displayName;
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/serializer_source_class.dart:146:31: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
'InterfaceType' is from 'package:analyzer/dart/element/type.dart' ('/Users/calvin/.pub-cache/hosted/pub.dartlang.org/analyzer-5.1.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
.map((type) => type.element.name)
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/serializer_source_class.dart:155:31: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
'InterfaceType' is from 'package:analyzer/dart/element/type.dart' ('/Users/calvin/.pub-cache/hosted/pub.dartlang.org/analyzer-5.1.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
.map((type) => type.element.name)
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/serializer_source_class.dart:196:42: Error: The getter 'element' isn't defined for the class 'DartType'.
'DartType' is from 'package:analyzer/dart/element/type.dart' ('/Users/calvin/.pub-cache/hosted/pub.dartlang.org/analyzer-5.1.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
final fieldTypeElement = fieldType.element;
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/serializer_source_class.dart:205:36: Error: The getter 'element' isn't defined for the class 'DartType'.
'DartType' is from 'package:analyzer/dart/element/type.dart' ('/Users/calvin/.pub-cache/hosted/pub.dartlang.org/analyzer-5.1.0/lib/dart/element/type.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
final typeElement = type.element;
^^^^^^^
[INFO] Precompiling build script... completed, took 809ms
[SEVERE] Failed to precompile build script .dart_tool/build/entrypoint/build.dart.
This is likely caused by a misconfigured builder definition.`
The text was updated successfully, but these errors were encountered:
flutter pub run build_runner build --delete-conflicting-outputs
I ran the above cmd to generate .g file 1 months ago, but now it reporting this error message.
Try to do flutter clean and pub get again, but it doesn't resolve the issue.
Can anyone help me to fix this issue?
Thanks
`[INFO] Generating build script completed, took 351ms
[WARNING] /Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/serializer_source_library.dart:125:43: Error: The getter 'element' isn't defined for the class 'DartType'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
SerializerSourceClass(type!.element as InterfaceElement)));
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/dart_types.dart:26:31: Error: The getter 'element' isn't defined for the class 'DartType'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
ValueSourceClass(type.element as ClassElement).settings.instantiable;
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/dart_types.dart:31:12: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
type.element.allSupertypes
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/dart_types.dart:75:25: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
return dartType.element.name + suffix;
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/dart_types.dart:80:28: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
return '${dartType.element.name}<$typeArgumentsStr>$suffix';
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/dart_types.dart:83:23: Error: The getter 'element' isn't defined for the class 'TypeParameterType'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
return dartType.element.name + suffix;
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/value_source_class.dart:78:45: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
.any((interfaceType) => interfaceType.element.name == 'Built');
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/value_source_class.dart:96:29: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
...element.supertype!.element.allSupertypes
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/value_source_class.dart:219:49: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
.where((interfaceType) => interfaceType.element.name == 'Builder')
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/value_source_class.dart:319:57: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
.where((interface) => needsBuiltValue(interface.element))
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/value_source_class.dart:328:55: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
.where((interface) => needsBuiltValue(interface.element))
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/value_source_class.dart:367:24: Error: The getter 'enclosingElement' isn't defined for the class 'MethodElement'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'enclosingElement'.
var clazz = method.enclosingElement;
^^^^^^^^^^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/value_source_class.dart:379:50: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
(interfaceType) => interfaceType.element.name == 'Built') ||
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/value_source_class.dart:1080:48: Error: The getter 'element' isn't defined for the class 'DartType'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
field.element.getter!.returnType.element!.displayName;
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/serializer_source_class.dart:146:31: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
.map((type) => type.element.name)
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/serializer_source_class.dart:155:31: Error: The getter 'element' isn't defined for the class 'InterfaceType'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
.map((type) => type.element.name)
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/serializer_source_class.dart:196:42: Error: The getter 'element' isn't defined for the class 'DartType'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
final fieldTypeElement = fieldType.element;
^^^^^^^
/Users/calvin/.pub-cache/hosted/pub.dartlang.org/built_value_generator-8.4.2/lib/src/serializer_source_class.dart:205:36: Error: The getter 'element' isn't defined for the class 'DartType'.
Try correcting the name to the name of an existing getter, or defining a getter or field named 'element'.
final typeElement = type.element;
^^^^^^^
[INFO] Precompiling build script... completed, took 809ms
[SEVERE] Failed to precompile build script .dart_tool/build/entrypoint/build.dart.
This is likely caused by a misconfigured builder definition.`
The text was updated successfully, but these errors were encountered: