Rehmat Khan
Rehmat Khan

Reputation: 13

How to accept Android Studio SDK Licences?

So coming straight to the issue on hand, I have installed the Android studio lastest version (3.6.3). But whenever I try to build a project and run it on Emulator it shows me an error that "I have not accepted the SDK licenses". It is not the only error that appears. I have attached a screenshot that you can see to have an idea of what the error actually is:

Gradle error

I tried to use the cmd method that accepts all the licenses but it is not working and cmd gives error "The system cannot find the path specified"

Cmd error

It is possible that I am accessing it wrong I am a complete cmd illiterate. After checking, there is no \tools\bin inside SDK folder

my path to sdk

Also, I have tried reinstalling.

Kindly help me out. All my work is stuck because of this error.

Upvotes: 1

Views: 2299

Answers (3)

pandagoespoop
pandagoespoop

Reputation: 99

This came up whilst googling the solution so I will pop the Linux solution here, which may also help windows users. The tools to accept the license have been moved.

Here's how I got the tools in Android Studio(Giraffe | 2022.3.1 Patch 2) on Linux.

1. Click Tools > SDK Manager

tools_sdk

2. Along the top, we have tabs.

Go to the SDK Tools tab and enable "Android SDK Command-line Tools(latest)".

Then Click Apply

sdktoolstabv3

3. Remember this path, we will need to open a terminal and cd to the SDK directory. getsdkpath

4. Open a terminal, cd to the SDK directory

Type the below into a terminal, replacing the sdk folder with the one you found in step #3.

# cd to the sdk folder
cd $HOME/Android/SDK
cd cmdline-tools/latest/bin
./sdkmanager --licenses
# press 'y' to accept the licenses.

And yes, you lucky winner, you have just accepted the google license. Thank you for participating in the license agreement marathon. And thank you to google for making it such a pleasure to accept. doneit

Upvotes: 1

jeprubio
jeprubio

Reputation: 18002

There is usually a link to the missing tools in the error console.

If not go in the menu to Tools / SDK

enter image description here

  • Then to the tab SDK Tools
  • Check the sdk Build Tools as it says the gradle error message
  • Check the missing platform in the SDK platforms tab that says the error message too

And then you'll be prompted to accept the licenses. Be careful because it's a radio button and is a little bit hiden.

enter image description here

If it fails after doing this watch in the console if there is a link to install the missing tools or other clues of other things missing apart from the build tools and the SDK platform.

Upvotes: 1

Rehmat Khan
Rehmat Khan

Reputation: 13

The issue is resolved. How I resolved it?

It was pretty easy though I just Installed three (3) more SDK-Platforms i-e Android 9.0, Android 8.1 and Android 8.0 by going to tools\sdkmanager\sdk-platforms in Android Studio IDE

I don't know why it fixed it but it did.

Upvotes: 0

Related Questions