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

Created on 1 May 2020  路  6Comments  路  Source: NativeScript/nativescript-cli

Hi i am trying to install flutter and getting an error when i type sdkmanager --list in the command prompt .I have added the environment variables correctly.I am attaching the screenshots that shows this problem and also the environment variables i am using and my directory structure.I am trying to install command line tools only and not android studio.How can i solve this error?

Screenshot (5251)
Screenshot (5252)
Screenshot (5253)
Screenshot (5254)

Most helpful comment

I think latest version '6200805' has some issue, even I got the same problem.

Solution: Use the older sdkmanager version, please find below links for older version.

Windows no installer: https://dl.google.com/android/repository/sdk-tools-windows-4333796.zip

MacOSX: https://dl.google.com/android/repository/sdk-tools-darwin-4333796.zip

Linux: https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip

All 6 comments

I think latest version '6200805' has some issue, even I got the same problem.

Solution: Use the older sdkmanager version, please find below links for older version.

Windows no installer: https://dl.google.com/android/repository/sdk-tools-windows-4333796.zip

MacOSX: https://dl.google.com/android/repository/sdk-tools-darwin-4333796.zip

Linux: https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip

Interestingly enough, downloading the older version from @krayanni 's link didn't work for me at first. However, when I used 7zip instead of the default windows unzip tool, it worked for me.
After unzipping, I ran sdkmanager --android-licenses in terminal and replied y to confirm every update.

@shad-1 is right using 7zip to extract worked great. Windows zip manager must have an issue when extracting the files

Interestingly enough, downloading the older version from @krayanni 's link didn't work for me at first. However, when I used 7zip instead of the default windows unzip tool, it worked for me.
After unzipping, I ran sdkmanager --android-licenses in terminal and replied y to confirm every update.

This worked for me as well, I used the latest version though.

Yes Use 7zip for the win!

Here's the link to the corresponding issue on the Android issue tracker: https://issuetracker.google.com/issues/154298380

Was this page helpful?
0 / 5 - 0 ratings

Related issues

donker picture donker  路  3Comments

ZMW9 picture ZMW9  路  3Comments

erjdriver picture erjdriver  路  3Comments

MrCroft picture MrCroft  路  3Comments

charsleysa picture charsleysa  路  3Comments