Android SDK packages some licences have not been accepted

Posted 怪兽N

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Android SDK packages some licences have not been accepted相关的知识,希望对你有一定的参考价值。

You have not accepted the license agreements of the following SDK components
Failed to install the following android SDK packages as some licences have not been accepted

问题

Caused by: org.gradle.api.GradleException: Failed to install the following Android SDK packages as some licences have not been accepted.
   platforms;android-30 Android SDK Platform 30
   build-tools;30.0.2 Android SDK Build-Tools 30.0.2
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

解决

首先进入sdk目录下的tools/bin下找到sdkmanager.bat
在这里插入图片描述然后输入

sdkmanager --licenses

在这里插入图片描述
最后不断y
在这里插入图片描述重新编译

以上是关于Android SDK packages some licences have not been accepted的主要内容,如果未能解决你的问题,请参考以下文章

mac Android licenses 报错 Failed to install the following Android SDK packages as some licences have n

Failed to install the following Android SDK packages as some licences have not been accepted 问题解决(代码

为啥android sdk manager install packages 点不了

Android sdk manager 显示 “Done loading packages”,该怎么办?

Android SDK Manager详解

Cannot find `aapt.exe`. Please install the Android SDK Build-tools package