Rajkiran Rajkiran - 1 year ago 245
Android Question

Android: set sdk.dir in local.properties to ANDROID_HOME environment variable

So the

file holds the reference to the Android SDK directory in
variable. For me it is
. On my CI machine, the
refers to the SDK directory which points to an invalid location since the username is different.

Is there any way so that I can set SDK directory as my

Perhaps something like this:
, so that on my CI machine, it will set the SDK directory from the environment variable?

Answer Source

local.properties should not be part of the versioned code. It's used as your local project configuration and Android Studio will create it based on on ANDROID_HOME if it doesn't exist yet.

If local.properties is not available, Gradle will use ANDROID_HOME automatically.

If local.properties is available, Gradle will use this file having a wrong sdk.dir set and fail.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download