你能帮我解决与 build_runner 相关的问题吗?在运行命令“flutter packages pub run build_runner watch --delete-conflicting-outputs”时,我得到 FileException errorno = 3 错误。
我怀疑这是一个Windows问题。因为报错信息中生成的路径是小写的('c:\users\xxxx\git-dev\flutter\xxx\xxxx\xxxx*'),而实际路径('C:\Users\xxxx\git -dev\Flutter\xxx\xxxx\xxxx*') 有几个大写字符。
[INFO] Generating build script...
[INFO] Generating build script completed, took 414ms
[INFO] Setting up file watchers...
[INFO] Setting up file watchers completed, took 11ms
[INFO] Waiting for all file watchers to be ready...
[SEVERE] Error from directory watcher for package:xxxxxx
If you see this consistently then it is recommended that you enable the polling file watcher with --use-polling-watcher.
You have hit a bug in build_runner
Please file an issue with reproduction steps at https://github.com/dart-enter code herelang/build/issues
FileSystemException: Directory listing failed, path =
'c:\users\xxxx\git-dev\flutter\xxx\xxxx\xxxx*' (OS Error: The system
cannot find the path specified., errno = 3)
Flutter doctor -v output is following:
[√] Flutter (Channel beta, 1.19.0-4.2.pre, on Microsoft Windows [Version 10.0.18363.900], locale en-IN)
• Flutter version 1.19.0-4.2.pre at C:\Users\xxxxxx\flutter
• Framework revision 9b9b543d92 (6 days ago), 2020-06-22 12:19:28 -0700
• Engine revision 9a28c3bcf4
• Dart version 2.9.0 (build 2.9.0-14.1.beta)
正如错误中的消息所建议的那样,我使用了“flutter pub run build_runner watch --use-polling-watcher”命令。但是,我开始遇到另一种错误。
AssetNotFoundException: xxxx_xxxxx|.packages
package:build_runner_core/src/asset/file_based.dart 134:18 _fileForOrThrow.
dart:async _completeOnAsyncReturn
package:pool/pool.dart Pool.withResource
package:build_runner_core/src/asset/file_based.dart 133:26 _fileForOrThrow
package:build_runner_core/src/asset/file_based.dart 33:48 FileBasedAssetReader.readAsBytes
package:build_runner/src/generate/watch_impl.dart 326:52 WatchImpl._run.
package:build_runner/src/generate/watch_impl.dart WatchImpl._run.
package:build_runner/src/generate/watch_impl.dart 355:6 WatchImpl._run
package:build_runner/src/generate/watch_impl.dart 196:20 new WatchImpl
package:build_runner/src/generate/watch_impl.dart 127:5 _runWatch
package:build_runner/src/generate/watch_impl.dart 85:15 watch
dart:async _completeOnAsyncReturn
package:build_runner_core/src/generate/options.dart BuildOptions.create
dart:async _completeOnAsyncReturn
package:build_runner_core/src/package_graph/target_graph.dart TargetGraph.forPackageGraph
dart:async _completeOnAsyncReturn
package:build_runner_core/src/package_graph/target_graph.dart _packageBuildConfig
dart:async _completeOnAsyncReturn
package:build_config/src/build_config.dart BuildConfig.fromBuildConfigDir