Android Build-tool 32.0.0 is missing DX
Asked by Abid Khan:

Hi,

Pipeline for an android project is failing due to missing DX file for build tools 32.0.0. I am using minimum android sdk 32 and build tools 32.0.0 for my project. I was using docker **image: androidsdk/android-30** and now updated to **image** **:** **androidsdk/android-31** but the error is same. On local machine I faced this issue and replaced the d8 files with dx and the build is successful but I think this also need to be done on bitbucket side as well.  
Please note that before updating android build tools to 32.0.0 I was able to run pipeline successfully this is just happening after update.

***Error:***  
Checking the license for package Android SDK Platform 32 in /opt/android-sdk-linux/licenses  
License for package Android SDK Platform 32 accepted.  
Preparing "Install Android SDK Platform 32 (revision: 1)".  
*"Install Android SDK Platform 32 (revision: 1)" ready.*  
*`Installing Android SDK Platform 32 in /opt/android-sdk-linux/platforms/android-32`*  
*`"Install Android SDK Platform 32 (revision: 1)" complete.`*  
*`"Install Android SDK Platform 32 (revision: 1)" finished.`*  
**`Build-tool 32.0.0 is missing DX at /opt/android-sdk-linux/build-tools/32.0.0/dx`**


Answers:
author: Theodora Boudale
body: Hi [@Abid Khan](/t5/user/viewprofilepage/user-id/5087698) and welcome to the community.

Bitbucket Pipelines builds run in Docker containers. We support public and private Docker images including those hosted on Docker Hub, AWS, GCP, Azure and self-hosted registries accessible on the internet. However, we do not own or maintain all the Docker images hosted in these registries.

If there are certain tools missing from the Docker image you use in your bitbucket-pipelines.yml file, then you can:

**1.** either install them during the build by adding the necessary commands in your bitbucket-pipelines.yml file

**2.** or use a different Docker image that has all the tools you need

**3.** or create a custom Docker image that has all the tools you need, and use that instead in your bitbucket-pipelines.yml file

In the following link, you can find more info on using Docker images as build environments. The last section, with the title "Creating a custom build environment", has resources on creating a custom Docker image.

* <https://support.atlassian.com/bitbucket-cloud/docs/use-docker-images-as-build-environments/>

Kind regards,  
Theodora

comments: author: Abid Khan
body: Hi [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) really appreciate the detail answer from you which makes sense to me. Thanks for pointing the docker image which I was too thinking about. I will give it a try.

Thank you once again.

Regards,

Abid


author: Theodora Boudale
body: You are very welcome Abid, please feel free to reach out if you need anything further.

I also wanted to let you know that we have the following guide for debugging Pipelines builds locally with Docker:

* <https://confluence.atlassian.com/bbkb/debug-pipelines-locally-with-docker-1167698072.html>

You may want to try this with different Docker images locally so that you don't consume your Pipelines minutes, until you get a successful build.

Kind regards,  
Theodora


author: Nic Brough -Adaptavist-
body: This is a flaw in your build environment, not Bitbucket. You'll need to fix up your build environment, and that's probably not even something you would store in Bitbucket, let alone be part of BB


Tags: bitbucket-cloud