简体   繁体   English

找不到 GitLab CI Android SDK

[英]GitLab CI Android SDK not found

I'm using a modified Docker image from jangrewe to automate the build.我正在使用来自 jangrewe 的修改过的 Docker 映像来自动化构建。 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. SDK 路径应该已经使用ENV ANDROID_HOME "/sdk"在 Docker 映像中定义,但是 GitLab 向我显示了这个错误: java.lang.RuntimeException: SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable. 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:所以我修改了我的 .gitlab-ci.yml 文件,如下所示:

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...我试图将 ANDROID_HOME 设置为环境变量两次,但显然这没有帮助......

Use environment variable ANDROID_SDK_ROOT="/sdk".使用环境变量 ANDROID_SDK_ROOT="/sdk"。 ANDROID_HOME environment variable is deprecated in newer version of android sdk. ANDROID_HOME 环境变量在较新版本的 android sdk 中已弃用。

For Reference: Android SDK environment variables参考: Android SDK 环境变量

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

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