Caching Android SDK in Travis CI
<p>I have few open sourced libraries on which I have setup Travis CI. They run fine, except that it takes them 25+ minutes to check a build. Most of the time is wasted in downloading dependencies and Android SDK platforms.  </p>

<p>I currently have the following in my .travis.yml</p>

<pre><code>language: android
jdk:
  - oraclejdk8
before_install:
- chmod +x gradlew
env:
  global:
   - ANDROID_API_LEVEL=24
   - EMULATOR_API_LEVEL=21
   - ANDROID_BUILD_TOOLS_VERSION=24.0.1
   - ANDROID_ABI=google_apis/armeabi-v7a
   - ADB_INSTALL_TIMEOUT=20 # minutes (2 minutes by default)

android:
  components:
    - tools
    - tools
    - platform-tools
    - build-tools-$ANDROID_BUILD_TOOLS_VERSION
    - android-$ANDROID_API_LEVEL
    - android-$EMULATOR_API_LEVEL
    - extra
    - add-on
    - extra-google-m2repository
    - extra-android-m2repository
    # Google Play Services
    - extra-google-google_play_services
    # Support library
    - extra-android-support

    - addon-google_apis-google-$ANDROID_API_LEVEL
    - addon-google_apis-google-$EMULATOR_API_LEVEL

    - sys-img-armeabi-v7a-addon-google_apis-google-$ANDROID_API_LEVEL
    - sys-img-armeabi-v7a-addon-google_apis-google-$EMULATOR_API_LEVEL

before_cache:
  - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
  directories:
    - $HOME/.gradle/wrapper
    - $HOME/.gradle/native
    - $HOME/.gradle/daemon
    - $HOME/.gradle/caches/jars-1
    - $HOME/.gradle/caches/2.3

before_script:
  - echo no | android create avd --force -n test -t android-21 --abi armeabi-v7a
  - emulator -avd test -no-skin -no-audio -no-window &amp;
  - android-wait-for-emulator
  - adb shell input keyevent 82 &amp;

script:
  - gradle clean check
</code></pre>

<p>As you can see I have already cached few gradle directories, but it's still not caching Android SDK platforms. I am sure I am missing few directories which I still need to cache.</p>

<p>Is there any way I can make the builds faster by caching those SDK platforms and dependencies? </p>