Flutter hive generator error when run build the adapter

Viewed 370

I am getting below error while generating .g.dart file by build runner command. Could you please help to figure out what's wrong here?

flutter packages pub run build_runner build

Unhandled exception:
Bad state: Unable to generate package graph, no `project/.dart_tool/flutter_gen/pubspec.yaml` found.
#0      _pubspecForPath (package:build_runner_core/src/package_graph/package_graph.dart:232:5)
#1      _parsePackageDependencies (package:build_runner_core/src/package_graph/package_graph.dart:206:21)
#2      PackageGraph.forPath (package:build_runner_core/src/package_graph/package_graph.dart:101:33)
<asynchronous suspension>
#3      main (file:///.../.pub-cache/hosted/pub.dartlang.org/build_runner-2.1.7/bin/build_runner.dart:27:30)
<asynchronous suspension>
pub finished with exit code 255

This is my pubspec:

dependencies:
   hive: 2.0.5
   hive_flutter: 1.1.0
dev_dependencies:
   hive_generator: 1.1.2
   build_runner: 2.1.7
   build_resolvers: 2.0.6

I have try to clean flutter and rebuild again. But, It still have the same error.

Have any suggest to solve it?

Thank you.

0 Answers
Related