I am assuming Ubuntu 19.10. At first, we need to install the JVM and JRE.
sudo apt update
sudo apt install openjdk-8-jdk openjdk-8-jre
Secondly, we need to set the environment variable JAVA_HOME:
sudo nano ~/.bashrc
Add this at the end of the file:
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
Run
source ~/.bashrc
Initiate gradle running
gradle -v
Make sure that the section marked with JVM shows your just installed JVM 1.8
Create a home-directory, move there and run
gradle init
Download Android Studio from here and extract it in your home directory (/home/ [username] /Android). Once extracted, set the ANDROID_HOME environment variable just like we did before. To get the necessary tools to build the Android build, execute
# *.nix./sdkmanager "platform-tools" "build-tools;25.0.3" "platforms;android-25" "extras;android;m2repository" "extras;google;m2repository"