When I try to run dart run build_runner build --delete-conflicting-output
I have the following uotput:
Failed to build build_runner:build_runner:
../../../.pub-cache/hosted/pub.dev/macros-0.1.2-main.4/lib/src/bootstrap.dart:5:1: Error: Error when reading '../../../fvm/versions/stable/bin/cache/dart-sdk/pkg/_macros/lib/src/bootstrap.dart': No such file or directory
export 'package:_macros/src/bootstrap.dart';
^
../../../.pub-cache/hosted/pub.dev/macros-0.1.2-main.4/lib/src/executor.dart:5:1: Error: Error when reading '../../../fvm/versions/stable/bin/cache/dart-sdk/pkg/_macros/lib/src/executor.dart': No such file or directory
export 'package:_macros/src/executor.dart';
^
../../../.pub-cache/hosted/pub.dev/macros-0.1.2-main.4/lib/src/executor/isolated_executor.dart:5:1: Error: Error when reading '../../../fvm/versions/stable/bin/cache/dart-sdk/pkg/_macros/lib/src/executor/isolated_executor.dart': No such file or directory
export 'package:_macros/src/executor/isolated_executor.dart';
^
../../../.pub-cache/hosted/pub.dev/macros-0.1.2-main.4/lib/src/executor/multi_executor.dart:5:1: Error: Error when reading '../../../fvm/versions/stable/bin/cache/dart-sdk/pkg/_macros/lib/src/executor/multi_executor.dart': No such file or directory
export 'package:_macros/src/executor/multi_executor.dart';
^
../../../.pub-cache/hosted/pub.dev/macros-0.1.2-main.4/lib/src/executor/process_executor.dart:5:1: Error: Error when reading '../../../fvm/versions/stable/bin/cache/dart-sdk/pkg/_macros/lib/src/executor/process_executor.dart': No such file or directory
export 'package:_macros/src/executor/process_executor.dart';
^
../../../.pub-cache/hosted/pub.dev/macros-0.1.2-main.4/lib/src/executor/serialization.dart:5:1: Error: Error when reading '../../../fvm/versions/stable/bin/cache/dart-sdk/pkg/_macros/lib/src/executor/serialization.dart': No such file or directory
export 'package:_macros/src/executor/serialization.dart';
^
../../../.pub-cache/hosted/pub.dev/macros-0.1.2-main.4/lib/macros.dart:5:1: Error: Error when reading '../../../fvm/versions/stable/bin/cache/dart-sdk/pkg/_macros/lib/src/api.dart': No such file or directory
export 'package:_macros/src/api.dart';
^
../../../.pub-cache/hosted/pub.dev/macros-0.1.2-main.4/lib/src/executor/introspection_impls.dart:5:1: Error: Error when reading '../../../fvm/versions/stable/bin/cache/dart-sdk/pkg/_macros/lib/src/executor/introspection_impls.dart': No such file or directory
export 'package:_macros/src/executor/introspection_impls.dart';
^
../../../.pub-cache/hosted/pub.dev/macros-0.1.2-main.4/lib/src/executor/response_impls.dart:5:1: Error: Error when reading '../../../fvm/versions/stable/bin/cache/dart-sdk/pkg/_macros/lib/src/executor/response_impls.dart': No such file or directory
export 'package:_macros/src/executor/response_impls.dart';
^
../../../.pub-cache/hosted/pub.dev/macros-0.1.2-main.4/lib/src/executor/exception_impls.dart:5:1: Error: Error when reading '../../../fvm/versions/stable/bin/cache/dart-sdk/pkg/_macros/lib/src/executor/exception_impls.dart': No such file or directory
export 'package:_macros/src/executor/exception_impls.dart';
^
../../../.pub-cache/hosted/pub.dev/macros-0.1.2-main.4/lib/src/executor/remote_instance.dart:5:1: Error: Error when reading '../../../fvm/versions/stable/bin/cache/dart-sdk/pkg/_macros/lib/src/executor/remote_instance.dart': No such file or directory
export 'package:_macros/src/executor/remote_instance.dart';
^
../../../.pub-cache/hosted/pub.dev/analyzer-6.7.0/lib/src/summary2/macro.dart:24:10: Error: Type 'macro.MacroInstanceIdentifier' not found.
Future<macro.MacroInstanceIdentifier> instantiate({
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/analyzer-6.7.0/lib/src/summary2/macro.dart:28:14: Error: Type 'macro.Arguments' not found.
required macro.Arguments arguments,
^^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/analyzer-6.7.0/lib/src/summary2/macro.dart:35:14: Error: Type 'macro.ExecutorFactoryToken' not found.
late final macro.ExecutorFactoryToken _executorFactoryToken;
^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/analyzer-6.7.0/lib/src/summary2/macro.dart:58:10: Error: Type 'macro.MacroInstanceIdentifier' not found.
Future<macro.MacroInstanceIdentifier> instantiate({
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/analyzer-6.7.0/lib/src/summary2/macro.dart:62:14: Error: Type 'macro.Arguments' not found.
required macro.Arguments arguments,
^^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/analyzer-6.7.0/lib/src/summary2/macro.dart:116:14: Error: Type 'macro.ExecutorFactoryToken' not found.
late final macro.ExecutorFactoryToken _executorFactoryToken;
^^^^^^^^^^^^^^^^^^^^^^^^^^
...
build_runner: ^2.4.12 and all generators injectable_generator, retrofit_generator, json_serializable and drift_dev at the last versions.
I tried to clean dart cache but without success.
2
Answers
I use FVM to handle flutter versions, for some reason the stable version was broken. I removed and checked out the stable version and now works.
Main issue here is absence of files which are part of Dart SDK (first lanes in error,
bootstrap.dart
and others). It may happen right after update because Dart SDK and binaries are not downloaded instantly. You can just runflutter doctor
and dependencies will be downloaded. You will see something like this in you terminal before actualdoctor
output:After that, those files will be available.