Android Cache not working

android
circle.yml

#1

Hello everyone

I just completed basic setup for CircleCI android project with default configuration.

In Spin up environment, It is downloading android:api-25-alpha image for every build. Isn’t it suppose to cache it ? every-time It spends around 1.02 minutes on this step.

Please let me know if I’m doing anything wrong or It is just supposed to be this way.

config.yml

version: 2
jobs:
  build:
    working_directory: ~/code
    docker:
      - image: circleci/android:api-25-alpha
    environment:
      JVM_OPTS: -Xmx3200m
    steps:
      - checkout
      - restore_cache:
          key: jars-{{ checksum "build.gradle" }}-{{ checksum  "app/build.gradle" }}
      - run:
          name: Download Dependencies
          command: ./gradlew androidDependencies
      - save_cache:
          paths:
            - ~/.gradle
          key: jars-{{ checksum "build.gradle" }}-{{ checksum  "app/build.gradle" }}
      - run:
          name: Run Tests
          command: ./gradlew clean assembleDebug
      - store_artifacts:
          path: app/build/outputs/apk
          destination: buildApk
      - store_test_results:
          path: app/build/test-results

Spin up Environment

Build-agent version 0.0.3666-afe1f24 (2017-07-17T11:25:45+0000)
Starting container circleci/android:api-25-alpha
  image cache not found on this host, downloading circleci/android:api-25-alpha
api-25-alpha: Pulling from circleci/android
c75480ad9aaf: Already exists
18d67befbc4e: Already exists
1f5d2d0853c7: Already exists
5de358416a75: Pulling fs layer
4049b231edea: Pulling fs layer
6617c62c7c10: Pulling fs layer
aa26fbcddb08: Pulling fs layer
d5b28339f9cb: Pulling fs layer
8d7b25fab67a: Pulling fs layer
04215b3498c9: Pulling fs layer
714b288e2430: Pulling fs layer
f39f908e2f14: Pulling fs layer
e6d4873c6942: Pulling fs layer
c8ebf6514bc7: Pulling fs layer
f39f908e2f14: Waiting
7d0c958200ea: Pulling fs layer
d22058e44a7a: Pulling fs layer
d5b28339f9cb: Waiting
c8ebf6514bc7: Waiting
8d7b25fab67a: Waiting
aa26fbcddb08: Waiting
7d0c958200ea: Waiting
7e1c25c8db13: Pulling fs layer
bc7e4018adbc: Pulling fs layer
7e1c25c8db13: Waiting
714b288e2430: Waiting
5882da455020: Pulling fs layer
49e22220b8f1: Pulling fs layer
81f7a66d8402: Pulling fs layer
da116762f71a: Pulling fs layer
81f7a66d8402: Waiting
49e22220b8f1: Waiting
9a231ac558f2: Pulling fs layer
bc7e4018adbc: Waiting
5882da455020: Waiting
da116762f71a: Waiting
411abda10d27: Pulling fs layer
98d22c087e0b: Pulling fs layer
411abda10d27: Waiting
98d22c087e0b: Waiting
9a231ac558f2: Waiting
4049b231edea: Verifying Checksum
4049b231edea: Download complete
6617c62c7c10: Verifying Checksum
6617c62c7c10: Download complete
aa26fbcddb08: Verifying Checksum
aa26fbcddb08: Download complete
8d7b25fab67a: Download complete
04215b3498c9: Verifying Checksum
714b288e2430: Verifying Checksum
714b288e2430: Download complete
5de358416a75: Verifying Checksum
5de358416a75: Download complete
e6d4873c6942: Verifying Checksum
e6d4873c6942: Download complete
c8ebf6514bc7: Verifying Checksum
c8ebf6514bc7: Download complete
7d0c958200ea: Verifying Checksum
7d0c958200ea: Download complete
d22058e44a7a: Download complete
7e1c25c8db13: Verifying Checksum
7e1c25c8db13: Download complete
bc7e4018adbc: Verifying Checksum
bc7e4018adbc: Download complete
f39f908e2f14: Verifying Checksum
f39f908e2f14: Download complete
5882da455020: Verifying Checksum
5882da455020: Download complete
81f7a66d8402: Verifying Checksum
81f7a66d8402: Download complete
da116762f71a: Download complete
d5b28339f9cb: Verifying Checksum
d5b28339f9cb: Download complete
5de358416a75: Pull complete
49e22220b8f1: Verifying Checksum
49e22220b8f1: Download complete
4049b231edea: Pull complete
6617c62c7c10: Pull complete
aa26fbcddb08: Pull complete
98d22c087e0b: Verifying Checksum
98d22c087e0b: Download complete
411abda10d27: Verifying Checksum
411abda10d27: Download complete
d5b28339f9cb: Pull complete
8d7b25fab67a: Pull complete
04215b3498c9: Pull complete
714b288e2430: Pull complete
f39f908e2f14: Pull complete
e6d4873c6942: Pull complete
9a231ac558f2: Verifying Checksum
9a231ac558f2: Download complete
c8ebf6514bc7: Pull complete
7d0c958200ea: Pull complete
d22058e44a7a: Pull complete
7e1c25c8db13: Pull complete
bc7e4018adbc: Pull complete
5882da455020: Pull complete
49e22220b8f1: Pull complete
81f7a66d8402: Pull complete
da116762f71a: Pull complete
9a231ac558f2: Pull complete
411abda10d27: Pull complete
98d22c087e0b: Pull complete
Digest: sha256:8d0c5b1ccf7f9bf0e154794c50c67ee5b760b6e3fcbe949e37b15ecf6aca79ad
Status: Downloaded newer image for circleci/android:api-25-alpha
  using image circleci/android@sha256:8d0c5b1ccf7f9bf0e154794c50c67ee5b760b6e3fcbe949e37b15ecf6aca79ad

Using build environment variables:
  BASH_ENV=/tmp/.bash_env-596d66fbc9e77c00014d59df-0-build
  CI=true
  CIRCLECI=true
  CIRCLE_BRANCH=master
  CIRCLE_BUILD_NUM=4
  CIRCLE_BUILD_URL=https://circleci.com/gh/karadkar/SampleCI/4
  CIRCLE_COMPARE_URL=https://github.com/karadkar/SampleCI/compare/6922f31709be...37241bed3ae6
  CIRCLE_ENV=/tmp/.bash_env-596d66fbc9e77c00014d59df-0-build
  CIRCLE_JOB=build
  CIRCLE_NODE_INDEX=0
  CIRCLE_NODE_TOTAL=1
  CIRCLE_PREVIOUS_BUILD_NUM=3
  CIRCLE_PROJECT_REPONAME=SampleCI
  CIRCLE_PROJECT_USERNAME=karadkar
  CIRCLE_REPOSITORY_URL=git@github.com:karadkar/SampleCI.git
  CIRCLE_SHA1=37241bed3ae6085456934b30d3a87463aeafe643
  CIRCLE_STAGE=build
  CIRCLE_USERNAME=karadkar
  CIRCLE_WORKING_DIRECTORY=~/code

Caching example
#2

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.