Каталог SDK не существует.GITLAB.COM CI - PullRequest
0 голосов
/ 29 января 2019

Я пытаюсь интегрировать CI в мой новый проект Anroid, создаю .gitlab-ci.yml, в репозитории существуют локальные свойства.Что я должен делать дальше?Теперь я получаю эту ошибку, когда запуск бегуна в gitlab

    FAILURE: Build failed with an exception.

    * What went wrong:
    A problem occurred configuring project ':app'.
    > The SDK directory '/Users/azamat/Library/Android/sdk' does not exist.

    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

    * Get more help at https://help.gradle.org

    BUILD FAILED in 48s
    ERROR: Job failed: exit code 1

Вот мой .gitlab-ci.yml.Я беру это из шаблона в gitlab.com.Я изменяю в этом файле только ANDROID_COMPILE_SDK, ANDROID_BUILD_TOOLS

    # This file is a template, and might need editing before it works on your project.
# Read more about this script on this blog post https://about.gitlab.com/2018/10/24/setting-up-gitlab-ci-for-android-projects/, by Jason Lenny
image: openjdk:8-jdk

variables:
  ANDROID_COMPILE_SDK: "27"
  ANDROID_BUILD_TOOLS: "27.0.3"
  ANDROID_SDK_TOOLS:   "4333796"

before_script:
  - apt-get --quiet update --yes
  - apt-get --quiet install --yes wget tar unzip lib32stdc++6 lib32z1
  - wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip
  - unzip -d android-sdk-linux android-sdk.zip
  - echo y | android-sdk-linux/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" >/dev/null
  - echo y | android-sdk-linux/tools/bin/sdkmanager "platform-tools" >/dev/null
  - echo y | android-sdk-linux/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null
  - export ANDROID_HOME=$PWD/android-sdk-linux
  - export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/
  - chmod +x ./gradlew
  # temporarily disable checking for EPIPE error and use yes to accept all licenses
  - set +o pipefail
  - yes | android-sdk-linux/tools/bin/sdkmanager --licenses
  - set -o pipefail

stages:
  - build
  - test

lintDebug:
  stage: build
  script:
    - ./gradlew -Pci --console=plain :app:lintDebug -PbuildDir=lint

assembleDebug:
  stage: build
  script:
    - ./gradlew assembleDebug
  artifacts:
    paths:
    - app/build/outputs/

debugTests:
  stage: test
  script:
    - ./gradlew -Pci --console=plain :app:testDebug

1 Ответ

0 голосов
/ 29 января 2019

Я решаю проблему с удалением local.properties из репозитория

...