Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cmdline-tools : could not determine SDK root

C:\Android\sdk\bin>sdkmanager Error: Could not determine SDK root. Error: Either specify it explicitly with --sdk_root= or move this package into its expected location: \cmdline-tools\latest\

it shows like this, even after specifying the root in env variables. ANDROID_SDK_ROOT C:\Android\sdk

I am using windows 10 64 bit machine, I want to run flutter without android studio so followed instruction on this page https://medium.com/@quicky316/install-flutter-sdk-on-windows-without-android-studio-102fdf567ce4

like image 492
alakmar Shafin Avatar asked Dec 12 '20 06:12

alakmar Shafin


People also ask

How do I find the SDK path in Linux?

Linux: ~/Android/Sdk. Mac: ~/Library/Android/sdk. Windows: %LOCALAPPDATA%\Android\sdk.

What is path to Sdkmanager install commandline Tools latest?

It is released concurrently with Android Studio and is installed in the android_sdk /cmdline-tools/ version /bin/ directory. For a complete description of the tools included in this package, see Command line tools in the user guide. To install the latest version, check the SDK Manager for updates.


2 Answers

Since new updates, there are some changes that are not mentioned in the documentation. After unzipping the command line tools package, the top-most directory you'll get is cmdline-tools. Rename the unpacked directory from cmdline-tools to tools, and place it under $C:/Android/cmdline-tools

now it will look like $C:/Android/cmdline-tools/tools

and it will work perfectly.

like image 95
alakmar Shafin Avatar answered Oct 19 '22 06:10

alakmar Shafin


Downloading the Android SDK 29+ (command line tools for Android) from https://developer.android.com/studio#downloads.

For "commandlinetools-linux-7302050_latest.zip" the process was different from earlier approaches. Earlier after unpacking, the top folder was called tools, but now the top folder is called cmdline-tools.

The problem seems to be that the sdkmanager expects to reside in an environment called. /YOURPATH/cmdline-tools/SOMETHING/bin but unpacks to /YOURPATH/cmdline-tools/bin for Linux anyway.

if you get

Error: Could not determine SDK root.

Error: Either specify it explicitly with --sdk_root= or move this package into its expected location: <sdk>/cmdline-tools/latest/

Unpack and make sure you have this path to the sdkmanager. /YOURPATH/cmdline-tools/latest/bin/sdkmanager

How To

To get this to work, first create the path to your intended Android SDK /opt/android-sdk/cmdline-tools/ then unpack the SDK zip file to that location, and you will have

/opt/android-sdk/cmdline-tools/cmdline-tools/bin/sdkmanager 

Now rename the second "cmdline-tools" to "latest"

/opt/android-sdk/cmdline-tools/latest/bin/sdkmanager 

And now it should work.

like image 41
Bo Kristensen Avatar answered Oct 19 '22 04:10

Bo Kristensen