如何获得Flutter Doctor的许可? [英] How to accept licenses with flutter doctor?
问题描述
在cmd中运行 flutter doctor
时,表明需要通过运行命令 flutter doctor --android-licenses接受android许可证
。
When running flutter doctor
in the cmd it is indicated that android licenses need to be accepted by running the command flutter doctor --android-licenses
.
运行命令给我一个错误,提示 repositories.cfg
无法在特定目录中找到。
我确实在目录中创建了一个空文件,并按照此SO帖子中的建议等待了4〜5分钟 repositories.cfg无法加载。
Running the command got me an error that a repositories.cfg
could not be found at a specific directory.
I did create the empty file in the directory and waited 4~5 minutes as suggested in this SO post repositories.cfg could not be loaded.
再次运行该命令会导致新的错误:
Running the command again results in a new error:
警告:安装过程中发生错误:无法移开或删除现有目标文件:
C:\installs\ \sdk\tools
手动将其移开,然后重试。.
Warning: An error occurred during installation: Failed to move away or delete existing target file:
C:\installs\sdk\tools
Move it away manually and try again..
删除tools文件夹没有解决问题。
Deleting the tools folder did not solve the issue.
要提示我接受Android许可证,我该怎么办?
What do I have to do to be prompted to accept the Android licenses?
推荐答案
一种解决此问题的方法是将 tools
文件夹复制到另一个位置(例如 C:\temp
)。然后使用 cd C :: temp\tools\bin
A way to resolve the issue is to copy the tools
folder to another place (e. g. C:\temp
). Then navigate the cmd to the directory with cd C:\temp\tools\bin
sdkmanager.bat --sdk_root=YOUR_DIRECTORY_HERE --licenses
YOUR_DIRECTORY_HERE
应该替换为原始SDK文件夹的路径( C:\installs\sdk
)。完成后,删除 C:\temp\tools
复制的文件夹。
YOUR_DIRECTORY_HERE
should be replaced with the path to your original SDK folder (C:\installs\sdk
). Once that is done, delete the C:\temp\tools
copied folder.
此答案受到影响通过无法更新\tools-适用于Windows的Android SDK命令行工具
这篇关于如何获得Flutter Doctor的许可?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!