How to accept licenses with flutter doctor?

半腔热情 提交于 2019-12-13 17:17:15

问题


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.

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:

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..

Deleting the tools folder did not solve the issue.

What do I have to do to be prompted to accept the Android licenses?


回答1:


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 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.

This answer was influenced by Can't update \tools - Android SDK Command Line Tools for Windows



来源:https://stackoverflow.com/questions/50434423/how-to-accept-licenses-with-flutter-doctor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!