Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ANDROID_HOME in bitbucket pipelines

I have the following bitbucket-pipelines.yml file as suggested in bitbucket's documentation -

image: java:8
pipelines:
  default:
    - step:
        script:
          - bash ./gradlew build

I get the following error on running a build -

BUILD FAILED
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

I don't know where the android home dir should be or is in a bitbucket pipeline runner. They haven't mentioned an export path either.

like image 241
SagunKho Avatar asked Sep 18 '25 18:09

SagunKho


1 Answers

It seems you have two problems here:

  • The SDK is obviously not present. Which means you either have to download it in your script at runtime (not recommended, as slow), or include it in a custom-built Docker image or use another Java image wich includes the SDK.
  • Then, set the environment variable using - export ANDROID_HOME=/path/to/sdk in your script. This might not be necessary if you find fully-prepared 3rd-party Docker image for your purposes.
like image 133
BlueM Avatar answered Sep 21 '25 07:09

BlueM