Flutter - 开发常见问题
2020-07-21 本文已影响0人
神灬渐入嘉靜
build_runner 报错
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 26:22 main
解决: flutter clean