Pub无法重命名目录,因为访问被拒绝



每当我运行flutter doctorflutter pub get时,我都会得到以下错误


Pub failed to rename directory because access was denied.     
This may be caused by a virus scanner or having a file in the directory open in another application.    
Running "flutter pub get" in flutter_tools...    
pub get failed (1; in the directory open in another application.)

我尝试了一些命令,在管理员模式下运行了这些命令,但仍然收到相同的错误。

对我来说,这有助于删除项目文件夹中的"pubspec.lock"文件,并再次运行flutter pub get

问题的根源是我直接在C目录中安装了flutter。在将它移到另一个目录(在MyUser/Downloads下为我工作(后,问题得到了解决。

我也遇到了类似的问题。

因此,在终端中运行flutter clean解决了这个问题。

我已经停用了我的防病毒功能,它对我有效!-停用防病毒

相关内容

最新更新