Android 12 buildtools version 31.0.0 issue when built on travis

Hi Travis,

We have requirement for migrating to Android12. so I have made following changes to the travis.yml file.

before_install:

  • touch $HOME/.android/repositories.cfg
  • yes | sdkmanager “platforms;android-31”
  • yes | sdkmanager “build-tools;31.0.0”

But I am getting following error at travis.

Build-tool 31.0.0 is missing DX at /usr/local/[secure]-sdk/build-tools/31.0.0/dx
Build-tool 31.0.0 is missing DX at /usr/local/[secure]-sdk/build-tools/31.0.0/dx
FAILURE: Build failed with an exception.
What went wrong:
Could not determine the dependencies of task ‘:app:bundleExperimentalDebugResources’.
Installed Build Tools revision 31.0.0 is corrupted. Remove and install again using the SDK Manager.

Please help me in fixing the issue.
Let me know if you need more info

Thanks ,
Krishna Chaitanya.

In my case it fails with

1.85s$ yes | sdkmanager "build-tools;31"
Warning: File /home/travis/.android/repositories.cfg could not be loaded.
Error: Failed to find package build-tools;31
The command "yes | sdkmanager "build-tools;31"" exited with 1.