AndroidStudio报Failed to install the following Android SDK packages as some licences have not been...

AndroidStudio安装成功,编译项目时,遇到了错误“Failed to install the following Android SDK packages as some licences have not been accepted”,该错误是SDK中的licences未被接受,解决办法如下:

  1. 打开cmd.exe(命令提示符)
  2. 进入SDK的安装目录下和tools下的bin目录:/tools/bin
  3. 输入 sdkmanager --licenses回车,在接下来出现的lisenses中都输入y接受这些licenses,在回到AndroidStudio中重新编译项目即可。
  4. 基本操作如下图:


    image.png

你可能感兴趣的:(AndroidStudio报Failed to install the following Android SDK packages as some licences have not been...)