Error running build_runner 'Infinite loop at build time

Asked

Viewed 318 times

1

I added the following packages and versions build_runner: ^1.10.2 and mobx_codegen: ^1.1.0+1 in the archive pubspec.yaml of my project Flutter and at the time of automatic code generation I got the following looping 'error/message':

...
[INFO] 31m 49s elapsed, 1/17 actions completed.
[INFO] 31m 50s elapsed, 1/17 actions completed.
[INFO] 31m 51s elapsed, 1/17 actions completed.
[INFO] 31m 53s elapsed, 1/17 actions completed.
[INFO] 31m 54s elapsed, 1/17 actions completed.
[WARNING] No actions completed for 15.0s, waiting on:
  - moor_generator:moor_generator on lib/login/login_store.dart
  - moor_generator:moor_generator on lib/login/widgets/background.dart
  - moor_generator:moor_generator on lib/login/account_picture.dart
  - moor_generator:moor_generator on lib/commom/widgets/custom_text_field.dart
  .. and 11 more
...

The message appeared repeatedly, as you can see about 30 minutes.

I’ve looked in some places for a solution like:

  1. https://github.com/simolus3/moor/issues/553
  2. https://gitter.im/dart-lang/build?at=5eb9a3f820eaac18530279ba

And I found a solution and I’d like to share.

1 answer

1


I don’t know if it’s the best solution but it worked for me, on the first link I mentioned (https://github.com/simolus3/moor/issues/553) I found the following cake recipe (but it may not suit your case, but it doesn’t hurt to try):

  1. Close all your open files (close all the file tabs in your IDE)

  2. Execute the command flutter clean on your terminal

  3. Execute the command flutter pub get on your terminal

  4. Execute the command flutter packages upgrade on your terminal

  5. Execute the command flutter packages pub run build_runner build on your terminal

  6. This item is not necessary but if the previous steps do not work, try before "step 1" adds the package build_resolvers: ^1.3.10 in your file pubspec.yaml in the section dev_dependencies.

    Would look like this:

    dev_dependencies:
      flutter_test:
       sdk: flutter
    
      build_resolvers: ^1.3.10
      mobx_codegen: ^1.1.0+1
      build_runner: ^1.10.2
    
    

As I said at the beginning is something that worked for me and may not work for you, I broke my head a lot until I found it (even if it’s something simple) but I hope it helps anyone suffering from the same mistake.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.