How to resolve failed to find target with hash string 'android-25'?

android
gradle
circle.yml

#1

Hey

I’m opening an issue similar to this with my android build:

When I run the circlci build, the android job fails at step gradlew assembleRelease -p with error:

A problem occurred configuring project ‘:react-native-localization’.
failed to find target with hash string ‘android-25’ in: /opt/android/sdk

I did try to remedy this by using the node image - circleci/android:api-25-node8-alpha but then I get the same error but instead for version android 23 as another
module requires this api version.

This gradle command works fine on my local just not on my circleci android build.

Any help with this issue would be great :slight_smile:

GIst of android job:

   android:
    working_directory: ~/repo/android
    docker:
      - image: circleci/android:api-23-node8-alpha
    steps:
      - checkout:
          path: ~/repo
      - 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-23.0.2"
      - run: echo y | android update sdk --no-ui --all --filter "build-tools-23.0.1"
      - run: echo y | android update sdk --no-ui --all --filter "build-tools-25.0.0"
      - run: sudo chmod +x ./gradlew
      #- run: ./gradlew clean
      - run: bundle install 
      - run: bundle exec fastlane beta 
      - store_artifacts:
          path: app/build/outputs/apk
          destination: apk

Link to my public build file: