Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"sdkmanager: command not found" after installing Android SDK

I installed via apt-get install android-sdk.

However, doing a find / -name sdkmanager reveals there is no such binary anywhere on the system.

On my Mac, the binary exists in $ANDROID_HOME/tools/bin.

However, on the Ubuntu system (the system with the issue), the binary does not exist there:

$ ls $ANDROID_HOME/tools/bin e2fsck fsck.ext4 mkfs.ext4 resize2fs screenshot2 tune2fs 

Where is the sdkmanager?

Edit:

Not sure why the above didn't install sdkmanager, however, one solution I found was to install manually (instead of via apt-get) by downloading the Linux files at https://developer.android.com/studio/#downloads under the "Command line tools only" header.

like image 219
Joncom Avatar asked Jan 01 '19 11:01

Joncom


People also ask

How do I fix Sdkmanager not found?

To Solve Android sdkmanager tool not found in Flutter The right solution would be if you have android studio installed then the command flutter doctor and it should now prompt you to run flutter doctor –android-licenses, once you run the license command, accept all licenses by hitting Y and it should solve the problem.

How do I find my Sdkmanager?

You can launch the SDK Manager in one of the following ways: From Eclipse (with ADT), select Window > Android SDK Manager. On Windows, double-click the SDK Manager.exe file at the root of the Android SDK directory.

How do I fix Android SDK not found?

Quick fix: Go to the Tools –> SDK manager –> SDK tools. Deselect Hide obsolete packages option on the right bottom and further install Android SDK Tools(obsolete). A new folder named Tools is now generated in the SDK directory. (C:\Users\..

How use Sdkmanager command-line?

In the unzipped cmdline-tools directory, create a sub-directory called latest . Move the original cmdline-tools directory contents, including the lib directory, bin directory, NOTICE.txt file, and source.properties file, into the newly created latest directory. You can now use the command line tools from this location.


2 Answers

On Ubuntu 18.04, the binary sdkmanager is indeed not included in the apt-package android-sdk.

This worked for me:

  1. Install android-sdk via apt, as you described:
apt-get install android-sdk 
  1. Set environment variable ANDROID_HOME if not done yet. For example:
export ANDROID_HOME=/usr/lib/android-sdk 
  1. Download and install the command line tools of Android Studio from https://developer.android.com/studio#downloads. You actually don't need the full Android Studio, just the command line tools.
wget https://dl.google.com/android/repository/commandlinetools-linux-6609375_latest.zip unzip commandlinetools-linux-6609375_latest.zip -d cmdline-tools sudo mv cmdline-tools $ANDROID_HOME/ export PATH=$ANDROID_HOME/cmdline-tools/tools/bin:$PATH 

By placing it as a subdirectory of ANDROID_HOME, you can further omit having to provide argument --sdk_root to sdkmanager as described here: Android Command line tools sdkmanager always shows: Warning: Could not create settings

like image 180
user3334891 Avatar answered Sep 25 '22 21:09

user3334891


Yes, apt-get does not install "tools" directory.

To Download Tools Directory ( which has sdkManager, etc..etc).

There are two ways

  1. From Android Studio --> SDK Manager --> Check "Show Obsolete packages" --> Download platform-tools

  2. Download Cmd Line tools directory directly from here and place it inside SDK

like image 44
Nandha Kumar Avatar answered Sep 22 '22 21:09

Nandha Kumar