skip to Main Content

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


  1. Chosen as BEST ANSWER

    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.


  2. 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 run flutter doctor and dependencies will be downloaded. You will see something like this in you terminal before actual doctor output:

    ~ flutter doctor
    Downloading Darwin arm64 Dart SDK from Flutter engine b8800d88be4866db1b15f8b954ab2573bba9960f...
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
     97  201M   97  197M    0     0  11.3M      0  0:00:17  0:00:17 --:--:-- 12.2M
    

    After that, those files will be available.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search