Hi, I'm using hive database on flutter and after upgrading I get this error when trying to generate type adapters.
flutter packages pub run build_runner build --delete-conflicting-outputs
Precompiling executable...
Precompiled build_runner:build_runner.
[INFO] Generating build script...
[INFO] Generating build script completed, took 304ms
You have hit a bug in build_runner
Please file an issue with reproduction steps at https://github.com/dart-lang/build/issues
NoSuchMethodError: Closure call with mismatched arguments: function 'MutablePackageTree.allPackages'
Receiver: Closure: (_SyncIterator<Package>) => bool
Tried calling: MutablePackageTree.allPackages()
Found: MutablePackageTree.allPackages(_SyncIterator<Package>) => bool
dart:core _SyncIterable.iterator
package:package_config/src/package_config_impl.dart 26:36 new SimplePackageConfig
package:package_config/src/package_config_json.dart 213:10 parsePackageConfigJson
package:package_config/src/package_config_json.dart 45:10 parsePackageConfigBytes
package:package_config/src/package_config_io.dart 117:10 readPackageConfigJsonFile
package:package_config/src/discovery.dart 109:18 findPackagConfigInDirectory
package:package_config/src/discovery.dart 44:31 findPackageConfig
package:package_config/package_config.dart 114:5 findPackageConfig
package:build_runner_core/src/package_graph/package_graph.dart 74:15 PackageGraph.forPath
package:build_runner_core/src/package_graph/package_graph.dart 110:20 PackageGraph.forThisPackage
package:build_runner/src/entrypoint/run.dart 22:64 run
.dart_tool\build\entrypoint\build.dart 22:22 main
pub finished with exit code 1
flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[鈭歖 Flutter (Channel master, 1.19.0-4.0.pre.99, on Microsoft Windows [Version 10.0.18363.836], locale en-US)
[鈭歖 Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[鈭歖 Chrome - develop for the web
[鈭歖 Android Studio (version 3.5)
[鈭歖 VS Code (version 1.45.1)
[鈭歖 Connected device (2 available)
Looks like a duplicate of this issue https://github.com/dart-lang/sdk/issues/41913, deleting your .dart_tool/build directory should resolve it.
Most helpful comment
Looks like a duplicate of this issue https://github.com/dart-lang/sdk/issues/41913, deleting your
.dart_tool/builddirectory should resolve it.