"Failed to install the following Android SDK packages as some licences have not been accepted" error "Failed to install the following Android SDK packages as some licences have not been accepted" error android android

"Failed to install the following Android SDK packages as some licences have not been accepted" error


You need to accept the licences before building.

According to Android SDK docs you can use the following command depending on the sdkmanager location: Docs on --licenses option seems to be missing though.

yes | sdkmanager --licenses

GNU/Linux Distributions:

yes | ~/Android/Sdk/tools/bin/sdkmanager --licenses

macOS:

export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Homeyes | ~/Library/Android/sdk/tools/bin/sdkmanager --licenses

Windows:

%ANDROID_HOME%/tools/bin/sdkmanager --licenses

Flutter:

> flutter doctor --android-licenses


In Android Studio go to Tools -> SDK Manager.

Go to SDK Tools tab.

Select the Android SDK Command-line Tools (latest) and download by pressing Apply.

enter image description here

On Windows, you can find the sdkmanager.bat at

C:\Users\[your_user]\AppData\Local\Android\Sdk\cmdline-tools\latest\bin

enter image description here


in Windows OS go to your sdkmanager path then execute

./sdkmanager.bat --licenses

You can find your sdkmanager in C:\Users\USER\AppData\Local\Android\Sdk\tools\bin

To find your actual android SDK path follow the red marked area of the below picture

enter image description here