I get this message :
You have hit a bug in build_runner
Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues
so, my build environment:
-
[2.0.0-edge.be6309690fd60284a87f3258a740c7c30efb1092 ] Dart SDK Version (
dart --version
) -
[build_runner ^0.10.0 ] What package(s) from this repo you are using, and the version (i.e.
build_runner 0.7.12
) -
[Just demo at https://flutter.io/json/ ] What builder(s) you are using (or writing yourself). Try to give a short summary of what they do.
-
[ MacOS] Whether you are using Windows, MacOSX, or Linux (if applicable)
-
[ iOS Simulator] Whether you are using Chrome, Safari, Firefox, Edge (if applicable)
-
[dependencies:
cupertino_icons: ^0.1.2
transparent_image: ^0.1.0
pull_to_refresh: ^1.1.5
json_annotation: ^1.0.0
dev_dependencies:
flutter_test:
sdk: flutter
build_runner: ^0.10.0
json_serializable: ^1.0.0
] Any other packages or constraints we should know about
error message:
NoSuchMethodError: The getter 'inputs' was called on null.
Receiver: null
Tried calling: inputs
dart:core
Object.noSuchMethod
/Users/zhangxianqiangmacbook/.pub-cache/hosted/pub.flutter-io.cn/build_runner_core-0.3.1+5/lib/src/asset_graph/serialization.dart
58:20 _AssetGraphDeserializer.deserialize
package:build_runner_core/src/asset_graph/graph.dart 42:48
new
AssetGraph.deserialize
package:build_runner_core/src/generate/build_definition.dart 209:38
_Loader._tryReadCachedAssetGraph.
package:build_runner_core/src/logging/logging.dart 25:30
logTimedAsync
package:build_runner_core/src/generate/build_definition.dart 207:12
_Loader._tryReadCachedAssetGraph
package:build_runner_core/src/generate/build_definition.dart 79:28
_Loader.prepareWorkspace
package:build_runner_core/src/generate/build_definition.dart 64:50
BuildDefinition.prepareWorkspace
package:build_runner_core/src/generate/build_impl.dart 106:49
BuildImpl.create
package:build_runner_core/src/generate/build_runner.dart 31:37
BuildRunner.create
package:build_runner/src/generate/build.dart 105:35
build
package:build_runner/src/entrypoint/build.dart 28:24
BuildCommand.run
package:args/command_runner.dart 194:27
CommandRunner.runCommand
package:args/command_runner.dart 109:29
CommandRunner.run.
dart:async
new
Future.sync
package:args/command_runner.dart 109:11
CommandRunner.run
package:build_runner/src/entrypoint/run.dart 22:31
run
.dart_tool/build/entrypoint/build.dart 18:22
main
pub finished with exit code 1
解决方法:deleted the /.dart_tool , then everything is okay