2
votes

I'd like to build my android project on a hosted build agent in VSTS. So I created an Android build definition, queued it up on a "Hosted Linux Preview" agent, and my build failed with this error:

SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable

As far as I can see, I have no direct access to the filesystem of the agent.
How can I find the location of the Android SDK?

1

1 Answers

2
votes

To build android project you will need a build agent on which the Android SDK is installed. You may use one of the following:

  • The Hosted VS2017 agent provided by VSTS, or
  • See Build and release agents for instructions on creating your own Linux, macOS, or Windows build agent. The Android SDK must be installed on your agent.

There isn't the Capability Android SDK in "Hosted Linux Preview" agent.

Just check the agent Capabilities for the hosted agents: ( Manage -> Agent Pools -> Hosted Linux Preview ->Click the Hosted agent -> Capabilities). You can see the location of the Android SDK from the agent capabilities if it existing there.

So, you can use the Hosted or Hosted VS2017 agent to build your android project instead of the Hosted Linux Preview agent.

Please see Build your Android app for details.

enter image description here