It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to setup for Android?

ZUNJAE Oct 18, 2016

Current setup:

image: java:8

pipelines:
  default:
    - step:
        script: # Modify the commands below to build your repository.
          - ./gradlew build

I am getting this warning: `SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.`

It does not make sense to edit the local.properties file, because that will ruin the project on my local pc. What am I supposed to do?

1 answer

0 votes
Steven Vaccarella Atlassian Team Oct 18, 2016

I'm not very familiar with android development, but have you tried defining the environment variable mentioned in the error message? Eg. with a line like this at the beginning of your script:

- export ANDROID_HOME=...

If that doesn't work then an alternative would be to create or overwrite the local.properties file in your script. For example you could add a file "pipelines.gradle.properties" to your repo and then copy it to "local.properties" at the beginning of your script:

- cp pipelines.gradle.properties local.properties

cheers,
Steven

ZUNJAE Oct 19, 2016

I managed to solve this by manually downloading the Android SDK and creating the local.properties

One last question: is it possible to keep the Android SDK on the server? It seems like a waste of bandwidth for Bitbucket having to download the full SDK every time I commit my code.

Joshua Tjhin Atlassian Team Oct 19, 2016

Interesting. Could you share your bitbucket-pipelines.yml?

Steven Vaccarella Atlassian Team Oct 19, 2016

To avoid downloading the Android SDK every time you'll need to use a docker image that already has it installed (instead of the "java:8" image). You should see if you can find a public image that someone else has already built (keeping in mind that it needs to have gradle too) or you can build one yourself that has all the tools you need.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

1,652 views 1 18
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you