I am trying to build an Android app using Gradle on Ubuntu 18.04. Android Studio is not installed o the machine (I use Eclipse for development but maintain a gradle toolchain).
The toolchain has worked on a different machine running Ubuntu 16.04. However, it does not work with gradle 3.4.1, which ships with 18.04, so I had to upgrade my build config. On the 18.04 machine, I changed the dependency
classpath 'com.android.tools.build:gradle:2.1.2'
to
classpath 'com.android.tools.build:gradle:2.3.0'
and changed
buildToolsVersion "23.0.3"
to
buildToolsVersion "25.0.3"
Now when I run gradle build
, I get the following error message:
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
However, I have ANDROID_HOME
set and pointing to ~/bin/android-sdk-linux
, which is the root dir of my Android SDK setup. Also, I have Android SDK build tools 25.0.3 installed locally.
What gives?