Failed to install the following Android SDK packages as some licences have not been accepted. 1

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

# macos:
export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home
yes | ~/Library/Android/sdk/tools/bin/sdkmanager --licenses

# windows:
%ANDROID_HOME%/tools/bin/sdkmanager --licenses

# GNU/Linux Distributions:
yes | ~/Android/Sdk/tools/bin/sdkmanager --licenses

Here is what the above code is Doing:
1. It’s setting the JAVA_HOME environment variable to the location of the JDK.
2. It’s accepting all the licenses for the Android SDK.

If you’re on Windows, you’ll need to run the above commands in a Command Prompt window.

If you’re on macOS or Linux, you’ll need to run the above commands in a Terminal window.

If you’re on macOS, you’ll need to replace the first line with the following:

export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home

If you’re on Linux, you’ll need to replace the first line with the following:

export JAVA_HOME=/opt/android-studio/jre

If you’re on Windows, you’ll need to replace the first line with the following:

set JAVA_HOME=C:\Program Files\Android\Android Studio\jre

If you’re on Windows, you’ll need to replace the second line with the following:

%ANDROID_HOME%/tools/bin/sdkmanager –licenses

If you’re on macOS or Linux, you’ll need to replace the second line with the following:

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

If you’re on macOS, you’ll need to replace the second line with the following:

yes | ~/Library/Android/sdk/tools/bin/sdkmanager –licenses

If you’re on Linux, you’ll need to replace the second line with the following:

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

If you’re on Windows, you’ll need to run the above commands in a Command Prompt window.

If you’re on macOS or Linux, you’ll need to run the above commands in a Terminal window.

If you’re on macOS, you’ll need to replace the first line with the following:

export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home

If you’re on Linux, you’ll need to replace the first line with the following:

export JAVA_HOME=/opt/android-studio/jre

If you’re on Windows, you’ll need to replace the first line with the following:

set JAVA_HOME=C:\Program Files\Android\Android Studio\jre

If you’re on Windows, you’ll need to replace the second line with the following:

%ANDROID_HOME%/tools/bin/sdkmanager –licenses

If you’re on macOS or Linux, you’ll need to replace the second line with the following:

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

If you’re on macOS, you’ll need to replace the second line with the following:

yes | ~/Library/Android/sdk/tools/bin/sdkmanager –licenses

If you’re on Linux, you’ll need to replace the second line with the following:

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

If you’re on Windows, you’ll need to run the above commands in a Command Prompt window.

If you’re on macOS or Linux, you’ll need to run the above commands in a Terminal window.

If you’re on macOS, you’ll need to replace the first line with the following:

export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/jdk/Contents/Home

Similar Posts