I am trying build an Android app with Jenkins and I have little control over Jenkins' slave machines.
In order to build the app I need the Android SDK installed on the slave, otherwise I get as expected:
"SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable."
That being the case, can gradle be configured to download the SDK as part of the build process and use it as a normal dependency?
Does this even make sense?
Thanks for the help.
The Gradle Android plugin supports automatic downloading of missing dependencies at build time; the trick is that accepted license agreements pertaining to the Android SDK must be bundled with the project to be built.
You basically just copy over the accepted license agreements from one spot where they have been accepted through Android Studio (your dev workstation probably), and ensure that they are copied as in to the Android SDK Home Directory on the Jenkins slave.
The files can be found in a license/
folder in the Android SDK folder, although the official documentation refers to the directory as licenses/
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With