sudo apt install openjdk-8-jdk-headless
wget https://dl.google.com/android/repository/commandlinetools-linux-6200805_latest.zip
mkdir -p Android/Sdk
unzip commandlinetools-linux-6200805_latest.zip -d Android/Sdk
export ANDROID_HOME=$HOME/Android/Sdk
# Make sure emulator path comes before tools. Had trouble on Ubuntu with emulator from /tools being loaded
# instead of the one from /emulator
export PATH="$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools:$PATH"
sdkmanager --sdk_root=${ANDROID_HOME} "tools"
sdkmanager --update
sdkmanager --list
sdkmanager "build-tools;28.0.3" "platform-tools" "platforms;android-28" "tools"
sdkmanager --licenses
sudo apt install gradle
Note: you can get an updated Android SDK link from https://developer.android.com/studio/#downloads
Used a combinaton of these gists: https://gist.github.com/fedme/fd42caec2e5a7e93e12943376373b7d0 https://gist.github.com/jjvillavicencio/18feb09f0e93e017a861678bc638dcb0
Background on the update to command line tools from android sdk https://stackoverflow.com/a/61176718
The latest version of cmdline tools (7302050_latest) seems to have a different directory structure. The folder is now called
cmdline-tools
instead oftools
so when you extract the folder it won't work as expected.sdkmanager
also seems to expect to want to be in${ANDROID_HOME}/cmdline-tools/latest/bin
but extracting it in ANDROID_HOME will just give you${ANDROID_HOME}/cmdline-tools/bin
...So it looks like unzipping the newest version to
${ANDROID_HOME}/cmdline-tools/cmdline-tools
will fix this, and remove the need to runsdkmanager --sdk_root....
Easiest way might just be tomkdir -p Android/cmdline-tools
and unzip to there & rename the second cmdline-tools tolatest
Not sure how this whole forking gists thing is supposed to work but here are the changes I used: https://gist.github.com/jason-s-yu/30375db45c1f71c1259e042d216e4bd3