Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 583
Prolight Avatar asked Mar 05 '20 00:03

Prolight


People also ask

How use Sdkmanager command-line?

To use the SDK Manager to install a version of the command line tools, follow these steps: Download the latest "command line tools only" package from the Android Studio downloads page and unzip the package. Move the unzipped cmdline-tools directory into a new directory of your choice, such as android_sdk .


1 Answers

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!

like image 176
Prolight Avatar answered Sep 30 '22 16:09

Prolight