Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitLab CI Android SDK not found

I'm using a modified Docker image from jangrewe to automate the build. The SDK path should already defined in the Docker image using ENV ANDROID_HOME "/sdk" but GitLab showed me this error: java.lang.RuntimeException: SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable. So I modified my .gitlab-ci.yml file like this:

image: tbremer19/wercker-container-android

before_script:
  - export ANDROID_HOME="/sdk"

build:
  script:
    - chmod 777 *
    - sudo ./gradlew assembleBetaDebug --stacktrace
  artifacts:
    paths:
    - app/build/outputs/apk/app-beta-debug.apk

but still get this error. Did anyone of you experience this? I tried to set ANDROID_HOME as an environment variable twice but apparently that didn't help...

like image 200
timbremer Avatar asked Aug 13 '16 16:08

timbremer


1 Answers

Use environment variable ANDROID_SDK_ROOT="/sdk". ANDROID_HOME environment variable is deprecated in newer version of android sdk.

For Reference: Android SDK environment variables

like image 127
hasnain Avatar answered Oct 22 '22 23:10

hasnain