Skip to content

build_runner build failed #692

Closed
Closed
@spermicide

Description

@spermicide

use your official example on this page:
https://pub.dev/packages/json_serializable

when I run
flutter packages pub run build_runner build

it says:

Precompiling executable...
Precompiled build_runner:build_runner.
[INFO] Generating build script...
[INFO] Generating build script completed, took 252ms

[WARNING] Deleted previous snapshot due to missing asset graph.
[INFO] Creating build script snapshot......
[INFO] Creating build script snapshot... completed, took 8.0s

[INFO] Initializing inputs
[INFO] Building new asset graph...
[INFO] Building new asset graph completed, took 402ms

[INFO] Checking for unexpected pre-existing outputs....
[INFO] Checking for unexpected pre-existing outputs. completed, took 1ms

[INFO] Running build...
[INFO] Generating SDK summary...
[SEVERE] json_serializable:json_serializable on lib/example.dart:

Bad state: Unexpected diagnostics:
F:\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on lib/example.dart:

Bad state: Unexpected diagnostics:
F:\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on lib/example.dart:

Bad state: Unexpected diagnostics:
F:\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on lib/example.dart:

Bad state: Unexpected diagnostics:
F:\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[SEVERE] json_serializable:json_serializable on lib/example.dart:

Bad state: Unexpected diagnostics:
F:\flutter\bin\cache\dart-sdk\lib\core\uri.dart:3259:39 - Expected an identifier.
[INFO] 1.4s elapsed, 1/5 actions completed.
[INFO] 2.5s elapsed, 1/5 actions completed.
[INFO] 3.6s elapsed, 1/5 actions completed.
[INFO] 4.7s elapsed, 1/5 actions completed.
[INFO] 5.8s elapsed, 1/5 actions completed.
[INFO] 6.9s elapsed, 1/5 actions completed.
[INFO] 8.0s elapsed, 1/5 actions completed.
[INFO] 9.1s elapsed, 1/5 actions completed.
[INFO] 10.2s elapsed, 1/5 actions completed.
[INFO] 11.3s elapsed, 1/5 actions completed.
[INFO] 12.4s elapsed, 1/5 actions completed.
[INFO] 13.5s elapsed, 1/5 actions completed.

and nothing generated

this is my version


dev_dependencies:

  build_runner: ^1.0.0
  json_serializable: ^3.4.0

dependencies:

  json_annotation: ^3.0.0

Flutter 1.20.2 

Tools • Dart 2.9.1

Hope you to tell me how can I do
thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions