My android project is built with Ant and i have to edit ant.properties
manually file to pass sdk.path
variable pointing to android sdk directory. i'm going to change it to get sdk path from environment variable to make build possible on Travis CI. What is android sdk variable for this?
Also i have some jni code to be built with android ndk, so the similar question - what is env variable for android ndk on Travis?
Don't use the Travis's Android support; it uses the old 'android' CLI instead of the new sdkmanager CLI that supports installing the NDK. Do something like:
And then in the 'install' section:
You can use the sdkmanager to install anything else you need. The benefit over the other answer is that this will grab the latest version of the NDK.
Finally, then you can set the environment variables ANDROID_HOME and ANDROID_NDK_HOME, and pass it to your specific environment.
Hope it helps.
Travis seems to provide Android support in beta. Android SDK can be found in
/usr/local/android-sdk
. However it seems that Android NDK is not provided and can't be found in/usr/local/android-ndk
. The simple (and expensive walkaround for Travis) is to download/extract/use it right while building like this:Feel free to comment this solution if you have a better one.
You can export the Android variables using this command as well as Clive Lee's method