How to accept android sdk license agreements when 'sdkmanager --licenses' won't work in 2020
Asked Answered
Y

2

9

I have installed 2 sdks in my Android folder aka in my (I'm on windows) C:\Users\XmyusernameX\Local\Android. One called \Sdk and another called \OldSdk. \OldSdk contains the one downloaded from android studio. It didn't come with the command line \tools folder so I put it in there myself. (I downloaded it from https://developer.android.com/studio/#downloads) When I try to do:

cd C:\Users\XmyusernameX\Local\Android\OldSdk\tools\bin

then:

sdkmanager.bat --licenses

I get:

 Error: Could not find or load main class com.android.sdklib.tool.sdkmanager.SdkManagerCli

So when I try to do the other one (I got this one from like a installer or something I don't know honestly)

When I do:

cd C:\Users\XmyusernameX\AppData\Local\Android\Sdk\tools\bin

then:

sdkmanager.bat --licenses

I get:

Error: Unknown argument --licenses
Usage: 
  sdkmanager [--uninstall] [<common args>] \
    [--package_file <package-file>] [<packages>...]
  sdkmanager --update [<common args>]
  sdkmanager --list [<common args>]
... it goes on...

So is there like a special place I need to download something like the \tools folder? Or something I need to configure?

Yale answered 5/3, 2020 at 0:36 Comment(0)
Y
12

Nevermind I got it. All you have to do is go into Android Studio, open a project, go into Tools > SDK Manager > SDK tools,

Check Android SDK tools, click apply then let it do it's thing, then go into the command line go to the path:

cd C:\Users\XmyusernameX\AppData\Local\Android\Sdk\tools\bin

Then run:

sdkmanager.bat --licenses

Then accept all finally it should all work!

Yale answered 5/3, 2020 at 1:6 Comment(5)
Would be still nice to know how it is working from command line.Nodal
I don't know. I had to reinstall my OS since this post.Yale
In Ubuntu there is no SDK Manager under ToolsCherenkov
Under Linux, if installed through Android Studio, sdkmanager should be in ~/Android/Sdk/tools/binDriven
Absolutely horrible design.Fully
S
1

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

Spin answered 29/10, 2023 at 12:0 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.