0

I'm running an android build with circleci 2.0 and get an error about missing build tools failed to find Build Tools revision 24.0.1 using the circleci/android:api-24-node8-alpha docker image.

I find an old solution for this but it targets the 1.0 cicrcleci instead of 2.0. - https://discuss.circleci.com/t/installing-android-build-tools-23-0-2/924 .

I tried the fix in the question but dependencies doesn't seem to be picked up in the YAML as suggested in the above link.

Question: Any idea why the build tools aren't being picked up in the circleci/android docker image?

The error is get exactly in circleci workflow is as follows:

command: ./gradlew androidDepedencies

error:

Configuring > 2/3 projectsFAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':app'. failed to find Build Tools revision 24.0.1

This is my android job spec and a link to my repo config.yaml:

 android:
    working_directory: ~/repo/android
    docker:
      - image: circleci/android:api-24-node8-alpha
    dependencies:
      pre:
        - echo y | android update sdk --no-ui --all --filter "tools"
        - echo y | android update sdk --no-ui --all --filter "build-tools-24.0.1"
    steps:
      - checkout:
          path: ~/repo
      - restore_cache:
          key: jars-{{ checksum "build.gradle" }}-{{ checksum  "app/build.gradle" }}
      - attach_workspace:
          at: ~/repo
      - run: echo 'export TERM=xterm' >> $BASH_ENV
      - run: sudo chmod +x ./gradlew
      - run: ./gradlew androidDepedencies    
      - run: ./gradlew assembleRelease
Brian Var
  • 6,029
  • 25
  • 114
  • 212

1 Answers1

0

I think the 'dependencies' can be avoided in CCI2.0.

dependencies: pre: - echo y | android update sdk --no-ui --all --filter "tools" - echo y | android update sdk --no-ui --all --filter "build-tools-24.0.1"

As you know the CCI2.0 works on a docker image-based system. You can find docker image files here and here. If you look into the DockerFile you can see all code which accepts licences and updates the SDKManager.

You may need to follow steps like

  • code check out
  • restore cache
  • download dependencies
  • save cache
  • assemble release
steps:
  - checkout
  - restore_cache:
      key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }}
  - run:
      name: Download Dependencies
      command: |
              sudo chmod +x gradlew
              ./gradlew androidDependencies
  - save_cache:
      paths:
        - ~/.gradle
      key: jars-{{ checksum "build.gradle" }}-{{ checksum  "app/build.gradle" }}
  - run:
      name: Take Build
      command: |
           ./gradlew clean
           ./gradlew assembleRelease

You can find a sample config file here

Sree...
  • 333
  • 2
  • 7