Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build_runner fails when combining analyzer 3.4.0 #1120

Closed
koji-1009 opened this issue Mar 24, 2022 · 2 comments
Closed

build_runner fails when combining analyzer 3.4.0 #1120

koji-1009 opened this issue Mar 24, 2022 · 2 comments

Comments

@koji-1009
Copy link

koji-1009 commented Mar 24, 2022

When analyzer 3.3.1 is combined with json_serializable, run build_runner build succeeds, but when combined with analyzer 3.4.0, run build_runner build fails.

https://pub.dev/packages/analyzer/versions/3.3.1
https://pub.dev/packages/analyzer/versions/3.4.0

I have created a project to reproduce it.
Update analyzer: 3.3.1 in pubspec.yaml to analyzer: 3.4.0 and run build_runner.

https://github.com/koji-1009/dart_analyzer_340_json_error

error log

$ dart run build_runner build --delete-conflicting-outputs
Building package executable... (5.1s)
Built build_runner:build_runner.
[INFO] Generating build script completed, took 605ms
[INFO] Precompiling build script... completed, took 769ms
[INFO] Building new asset graph completed, took 539ms
[INFO] Checking for unexpected pre-existing outputs. completed, took 1ms
[SEVERE] freezed:freezed on lib/model/person.dart:

InconsistentAnalysisException: Requested result might be inconsistent with previously returned results

[SEVERE] json_serializable:json_serializable on lib/model/person.dart:

InconsistentAnalysisException: Requested result might be inconsistent with previously returned results

[SEVERE] json_serializable:json_serializable on lib/model/api_response.dart:

InconsistentAnalysisException: Requested result might be inconsistent with previously returned results

[SEVERE] json_serializable:json_serializable on lib/main.dart:

InconsistentAnalysisException: Requested result might be inconsistent with previously returned results

[INFO] Running build completed, took 12.1s
[INFO] Caching finalized dependency graph completed, took 32ms
[SEVERE] Failed after 12.1s
$ flutter --version
Flutter 2.10.3 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7e9793dee1 (3 weeks ago) • 2022-03-02 11:23:12 -0600
Engine • revision bd539267b4
Tools • Dart 2.16.1 • DevTools 2.9.2
@mtwichel
Copy link

I encountered the same issue in our project. Manually specifiying analyzer: 3.3.1 fixed the issue for me as well. Thanks for the workaround!

@koji-1009
Copy link
Author

analyzer 3.4.1 is released!

https://pub.dev/packages/analyzer/versions/3.4.1
dart-lang/sdk#48658

chunghha added a commit to chunghha/fl_template that referenced this issue Apr 21, 2022
watch out for the analyzer version specified, google/json_serializable.dart#1120
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants