任何时候我尝试运行flutter在窗口,我得到的错误如下
Launching lib\main.dart on Windows in debug mode...
main.dart:1
Nuget.exe not found, trying to download or use cached version.
Unable to obtain lock file access on 'C:\Users\pannam\AppData\Local\Temp\NuGetScratch\lock' for operations on 'C:\Users\pannam\AppData\Roaming\NuGet\NuGet.Config'. This may mean that a different user or administrator is holding this lock and that this process does not have permission to access it. If no other process is currently performing an operation on this file it may mean that an earlier NuGet process crashed and left an inaccessible lock file, in this case removing the file 'C:\Users\pannam\AppData\Local\Temp\NuGetScratch\lock' will allow NuGet to continue.
CMake Error at flutter/ephemeral/.plugin_symlinks/geolocator_windows/windows/CMakeLists.txt:33 (message):
Failed to install nuget package Microsoft.Windows.CppWinRT.2.0.210806.1
Exception: Unable to generate build files
Exited (sigterm)
我是Flutter医生
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.10.5, on Microsoft Windows [Version 10.0.22621.1702], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc1)
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.6.3)
[√] Android Studio (version 2020.3)
[√] VS Code (version 1.79.2)
[√] Connected device (3 available)
[√] Network resources
1条答案
按热度按时间wko9yo5t1#
我想你已经尝试过删除文件steal have
C:\Users\pannam\AppData\Local\Temp\NuGetScratch\lock
,就像错误堆栈跟踪中建议的那样,但是如果你没有,你可以尝试这样做。否则,您可以在应用根文件夹上运行“flutter clean”。
如果仍然不起作用,您可以尝试删除windows文件夹并运行命令
flutter create --platforms=windows .
它将正确地重新创建windows文件夹。对于您的信息,您可以使用终端中的第一行运行Windows应用程序(我每次在Windows上启动应用程序时都有这一行)。
Nuget.exe not found, trying to download or use cached version.
错误中真实的有趣的部分是接下来的几行。