Android SDK Support Library 24

Continuing the discussion from Android SDK installation is missing:

Continuing this, since I’m not sure if it was ever resolved and I ran into a related issue.

The latest version of Android SDK on Trusty is 23, and new projects appear to default to 24. In addition, the Android Support library 24 does an fantastic job of hiding, only 23 shows.

The following circle.yml frangment resolved my dependancy issues (at least on my bare bones starter project)

dependencies:
  pre:
    # Trusty only comes with 22 and 23 of the SDK
    # 3- Android SDK Platform-tools, revision 24.0.1
    - echo y | android update sdk --no-ui --all --filter "android-24","build-tools-24.0.1","extra-android-m2repository"

“extra-android-m2repository” being the elusive Android Support Library, revision 24.1.0

1 Like

I definitely run into this issue a lot - these commands definitely add another couple minutes to the build.

Is there a canonical place I can check to see what SDKs are installed? Once the SDK’s are finally installed on the machines, I remove these lines to shave off build time. Would be great to have a page to check what SDKs are installed.

https://circleci.com/docs/1.0/build-image-trusty/#android

and

https://circleci.com/docs/1.0/build-image-precise/#android

O fantastic, thanks!

To expand on this, a form of caching (since the Android SDK doesn’t check if the files already exist)

dependencies:
  pre:
    # Android SDK Platform 24
    - if [ ! -d "/usr/local/android-sdk-linux/platforms/android-24" ]; then echo y | android update sdk --no-ui --all --filter "android-24"; fi
    # Android SDK Build-tools, revision 24.0.1
    - if [ ! -d "/usr/local/android-sdk-linux/build-tools/24.0.1" ]; then echo y | android update sdk --no-ui --all --filter "build-tools-24.0.1"; fi
    # Android Support Repository, revision 35 / Local Maven repository for Support Libraries
    - if [ ! -d "/usr/local/android-sdk-linux/extras/android/m2repository/com/android/support/design/24.1.0" ]; then echo y | android update sdk --no-ui --all --filter "extra-android-m2repository"; fi
    

  cache_directories:
    - /usr/local/android-sdk-linux/platforms/android-24
    - /usr/local/android-sdk-linux/build-tools/24.0.1
    - /usr/local/android-sdk-linux/extras/android/m2repository
3 Likes