google / google/built_value.dart
Failed to precompile build script .dart_tool/build/entrypoint/build.dart
- Dominant language
- Dart
- Stars
- 886
- Forks
- 195
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 4
Description
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.`
Contributor guide
Assessment
This issue has not been assessed yet.