Skip to content

Instantly share code, notes, and snippets.

  • Star 20 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Getting Started: Android Development with Gradle (without Android Studio)

Getting Started: Android Development with Gradle (without Android Studio)

Install JDK

Open Terminal. Type javac -version and check your current JDK version. If you seem to have javac 1.7.* JDK version, you can skip this section.

  • Open Termianl.
  • Type sudo apt-get install openjdk-7-jdk.

Download Android SDK (standalone tools)

Download the standalone SDK tools from official website.

Tip: I renamed my SDK tools directory to "sdk" and put it in to ~/dev/android/.

Add SDK Packages

  • Open Terminal.
  • Navigate to .../sdk-directory/tools/.
  • Run ./android sdk.
  • Add necessary SDK packages.

Set up PATH Environment variable

Open ~/.profile or ~/.bashrc in your text editor and add following lines.

export ANDROID_HOME=~/location/to/your/android/sdk
export PATH=$PATH:$ANDROID_HOME/tools/
export PATH=$PATH:$ANDROID_HOME/platform-tools/

Create Project

This will create the project with gradle.

android create project -p /location/to/MyProject -a MainActivity -k com.domain.myproject -t <target-id> -g -v 0.12.+

<target-id>: Type android list targets in Terminal to get all available sdks.

Build with Gradle

./gradlew build

Install Application to Device

./gradlew installDebug

Still having issues?
Open build.gradle and see if your gradle version (type ./gradlew --version in Terminal) is compatible with version. Read more

Or drop me a message @

Copy link

mojtabamarashee commented Jul 3, 2018

How to manually configure Gradle to build an existing android project that is created without "android create project"?


Copy link

android tool is deprecated and removed from android-sdk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment