Android SDK目录不存在。GITLAB.COM

Android SDK目录不存在。GITLAB.COM,android,continuous-integration,gitlab,Android,Continuous Integration,Gitlab,我尝试将CI集成到我的新Anroid项目中,我在存储库中创建.gitlab-CI.yml、local.properties。我下一步该怎么办?现在,当runner在gitlab中启动时,我收到了这个错误 FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':app'. > The SDK directory '

我尝试将CI集成到我的新Anroid项目中,我在存储库中创建.gitlab-CI.yml、local.properties。我下一步该怎么办?现在,当runner在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_编译_SDK、ANDROID_构建_工具

    # 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

我解决了从存储库中删除local.properties的问题

我解决了从存储库中删除local.properties的问题

请发布完整的gitlab ci。yml@MilindMevada不要发布完整的gitlab ci。yml@MilindMevadadone您应该在.gitignore文件中添加local.properties文件,因为该文件包含特定的信息您的机器应在.gitignore文件中添加local.properties文件,因为此文件包含您机器的特定信息