Of course you need to install the Java Development Kit.
sudo apt-get install openjdk-8-jdk
... e.g. in the terminal should do the trick.
EDIT:
There's a manual workaround!
As per post https://stackoverflow.com/a/42733510/7694425 :
- Download the command line tools, place them in the SDK folder (e.g.,
on mac: /Users/user/Library/Android/sdk), and then add the bin
folder to the PATH.
- Install the latest platform: in a terminal,
execute sdkmanager "platforms;android-25"
- Open Android Studio, and
go to the SDK Manager (Appearance and Behavior > System Settings >
Android SDK)
- Click on "Edit", and then select the sdk folder. Then
"Next" > "Next" > "Finish".
Still, it doesn't resolve the missing emulator package therefore the Android SDK tools can't be updated since it's a dependency. But Android studio works and you can download other packages.
Looking forward to a better solution.
Update 2:
Solution to emulator package issue!
After digging in the repo's XML for a while I've spotted the issue.
It turns out that the "emulator" package is only in channel 3 (canary) while the "tools" package is in channel 0 (stable) but depends on "emulator". The solution is to force the manager to download the "emulator" package from channel 3:
./sdkmanager --channel=3 emulator
Problem solved!