google / google/json_serializable.dart

`build_runner` never finishes building

Open
#1,285 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Dart
Stars
1.6k
Forks
461
Avg merge
45m
Merged PRs (30d)
1

Description

`flutter --version`:
```terminal
Flutter 3.8.0-10.1.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision 1a0a03a41d (4 days ago) • 2023-02-16 22:03:58 -0600
Engine • revision 639e313f99
Tools • Dart 3.0.0 (build 3.0.0-218.1.beta) • DevTools 2.21.1
```

I'm trying to run `dart run build_runner build` in https://github.com/dart-lang/jnigen/tree/main/jnigen but it never ends.

```terminal
❯ dart run build_runner build
Building package executable... (3.7s)
Built build_runner:build_runner.
[INFO] Generating build script completed, took 193ms
[WARNING] Invalidated precompiled build script due to missing asset graph.
[INFO] Precompiling build script... completed, took 3.2s
[INFO] Building new asset graph completed, took 2.8s
[INFO] Found 1 declared outputs which already exist on disk. This is likely because the`.dart_tool/build` folder was deleted, or you are submitting generated files to your source repository.
Delete these files?
1 - Delete
2 - Cancel build
3 - List conflicts
1
[INFO] Checking for unexpected pre-existing outputs. completed, took 3m 50s
[INFO] Generating SDK summary completed, took 2.7s
[INFO] 6m 41s elapsed, 12359/12360 actions completed.
```

More and more actions keep being added. There is only a single file with a handful of classes containing JsonSerializable annotations.

I also tried `flutter clean` and running `flutter pub run build_runner build` instead of `dart run build_runner build` with the same results.

Relevant dev dependencies:

```yaml
build_runner: ^2.2.0
json_serializable: ^6.6.0
```

Relevant dependencies:
```yaml
json_annotation: ^4.8.0
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.