bitbucket管道中的ANDROID_HOME

时间:2017-10-12 16:53:01

标签: android gradle android-gradle bitbucket bitbucket-pipelines

我有bitbucket' s documentation中建议的以下bitbucket-pipelines.yml文件 -

image: java:8
pipelines:
  default:
    - step:
        script:
          - bash ./gradlew build

运行构建时出现以下错误 -

BUILD FAILED
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

我不知道android主目录应该在哪里或者在bitbucket管道运行器中。他们也没有提到出口路径。

1 个答案:

答案 0 :(得分:1)

这似乎你有两个问题:

  • SDK显然不存在。这意味着您必须在运行时在script下载(不推荐,速度很慢),或者将其包含在自定义构建的Docker镜像中,或者使用包含SDK的其他Java映像。
  • 然后,使用- export ANDROID_HOME=/path/to/sdk中的script设置环境变量。如果您找到完全准备好的第三方Docker镜像,则可能没有必要这样做。