Failure to find build tools 24.0.1 Android build in CircleCI 2.0

I’m opening an issue similar to Installing android build tools 23.0.2 which was a solution for missing android build tools in circleci 1.0

But this is relating to the circleci 2.0 syntax, I tried the fix in the question but dependencies doesn’t seem to be picked up in the YAML.

Any idea why the build tools aren’t being picked up in the circleci/android:api-24-node8-alpha image?

Or any possible workaround would be sweet. :slight_smile:

The error is get exactly in circleci workflow details 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

This is not a valid key in 2.0, this was the 1.0 syntax. You should add these as jobs instead.

 android:
    working_directory: ~/repo/android
    docker:
      - image: circleci/android:api-24-node8-alpha
    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: echo y | android update sdk --no-ui --all --filter "tools"
      - run: echo y | android update sdk --no-ui --all --filter "build-tools-24.0.1"
      - run: sudo chmod +x ./gradlew
      - run: ./gradlew androidDepedencies    
      - run: ./gradlew assembleRelease
1 Like

Thanks for the explanation!

1 Like

My pleasure! Glad this worked out for you.