我正在处理一个flutter项目,当我尝试向pubspec.yaml文件添加新的包或资产并尝试使用“flutter pub get”命令添加依赖项时,该过程并没有结束,退出代码为0。 我用的是VSCode。
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.
A:\Docs\Flutter\messenger>flutter pub get
Running "flutter pub get" in messenger... 0.7s
A:\Docs\Flutter\messenger>
另外,如果在获取退出代码时忽略,则依赖关系不会反映在代码中,并会出现错误消息
Try creating the file referenced by the URI, or Try using a URI for a file that does exist.darturi_does_not_exist
我也试过get packages按钮,但也不行。 当我尝试添加资产时,这个问题也会发生在资产上
assets:
- assets\images\
则显示类似错误代码
The asset assets\images\ does not exist.
Try creating the file or fixing the path to the file.
通常,当pub get给出错误时,给出错误的是其他东西,而不是实际的'pub get'命令。 在运行'pub get'命令之前,请确保您的项目中没有任何错误。 由于您没有给出足够的信息,很难提供更多可能对您有帮助的选项。 如果您需要更多的帮助,请出示您的代码/颤振医生。