简体   繁体   English

SDK目录不存在。 GITLAB.COM CI

[英]The SDK directory does not exist. GITLAB.COM CI

I try to integrate CI to my new Anroid project, I create .gitlab-ci.yml, local.properties exist in repository. 我尝试将CI集成到我的新Anroid项目中,创建.gitlab-ci.yml,local.properties存在于存储库中。 What i should next to do? 我接下来该怎么办? Now I recive this error, when runner start in gitlab 现在,当跑步者在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

Here is my .gitlab-ci.yml. 这是我的.gitlab-ci.yml。 I take it from template in gitlab.com. 我从gitlab.com中的模板中获取。 I change in this file just ANDROID_COMPILE_SDK, ANDROID_BUILD_TOOLS 我仅在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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM