Questions tagged [build-runner]

96 questions
1
vote
1 answer

build_runner watch does not exit after builds

Different from build_runner build command, build_runner watch does not exit after its build. So, every time I use it, I type Ctrl+c to exit. Any solutions? Thank you.
Masahiro Aoki
  • 815
  • 12
  • 22
1
vote
0 answers

How can I run both json_serializable and my custom builder?

package:my_custom_type_generator build.yaml builders: extractTypes: import: "package:my_custom_type_generator/builder.dart" builder_factories: ["extractTypes"] build_extensions: {'$lib$': ['extracted-types.json']} build_to: source …
natebot13
  • 167
  • 3
  • 11
1
vote
0 answers

With Dart source code, is there an Object Oriented way to parse and modify it?

The pseudo code for what I would like to do: var classObject=Parse(templateFile); classObject.functions.add(MyGeneratedFunction) return classObject.toSourceCode() I really feel like I'm missing something here. I know I can use analysis to parse a…
1
vote
1 answer

build_runner failing for classes extending hiveobject

Build-Runner generation is failing for classes that extends HiveObject. Without this extension, the build runs successfully. Is this a known issue with a solution? One of the affected classes: @HiveType(typeId: 3) @JsonSerializable() class…
Donatic
  • 323
  • 1
  • 13
1
vote
4 answers

Build runner error Could not start worker thread: result = 22

The problem is it showing 315: error: Could not start worker thread: result = 22.
Aswanath C K
  • 171
  • 11
1
vote
0 answers

Auto_route & build_runner disable NullSafety

I'm trying to use auto_route library with build_runner, but each time my build_runner generate my router.gr.dart file, it does generate code with null safety, while I'm not using it in my project. Is there a way to tell build_runner to generate code…
gizon_dev
  • 36
  • 1
  • 5
1
vote
1 answer

Flutter failed to build build_runner with Freezed

I am facing this issue when I added a new property to the Freezed class for the first time in three months, and then run flutter clean && flutter pub get && flutter pub run build_runner build --delete-conflicting-outputs. And I tried the answers on…
1
vote
2 answers

Unhandled Exception: HiveError: Cannot write, unknown type: TimeOfDay. Did you forget to register an adapter?

I am trying to add data to my hive box. I have initialised hive, opened the box and then added data into the box. However I get an error asking stating that TimeOfDay is an unknown time although I have already registered/built a time adapter. I have…
Vortenzie
  • 75
  • 9
1
vote
0 answers

How to filter build_runner input by extension?

I am trying to make my custom builder using Dart's https://github.com/dart-lang/source_gen. The buildExtensions in builder.dart is .dart It builds for any dart file buildExtensions = { '.dart':…
TSR
  • 17,242
  • 27
  • 93
  • 197
1
vote
1 answer

When running build runner on flutter I get the following error

When I run flutter packages pub run build_runner build --delete-conflicting-outputs I get the following error. Failed to precompile…
wamae
  • 660
  • 9
  • 21
1
vote
1 answer

Getting "NoSuchMethodError: The getter 'element' was called on null." when using build_runner

I'm pretty new to flutter so let me know if anyone needs more info. I've been trying to use Hive with my flutter app. I want to generate a custom adapter for a class I wrote called Product. When I run "flutter packages pub run build_runner build",…
1
vote
1 answer

Error: Not found: 'dart:ui' on build_runner build

I'm trying to run the build_runner build command: $ flutter packages pub run build_runner build --delete-conflicting-outputs But I'm getting the following error: C:\tools\flutter\bin\flutter.bat packages pub run build_runner build…
1
vote
3 answers

Can't create moor_database.g.dart file

every time i run the "build_runner watch" command i get an error that 0/3 actions completed i have all the dependencies with their last update i tried to search the problem but couldn't find any solution yet.. still searching and i hope if i can…
Idris
  • 43
  • 5
0
votes
2 answers

What to run instead of flutter packages pub run build_runner build --delete-conflicting-outputs

My Flutter app requires code generation for multiple reasons, such as mock generation for tests, or both Floor and Isar persistence back-ends require generation. I achieve this by executing flutter packages pub run build_runner build…
Csaba Toth
  • 10,021
  • 5
  • 75
  • 121
0
votes
0 answers

Failed to build build_runner:build_runner

I am receiving the following error message when I run: flutter pub run build_runner build --delete-conflicting-outputs Error I tried: flutter clean flutter pub cache repair flutter pub run build_runner clean and then flutter pub run…