【发布时间】:2018-04-04 17:45:32
【问题描述】:
尝试在 CircleCI 上构建项目时,在 gradle 构建过程中出现以下错误。这个问题的原因是什么?我正在运行 CircleCI 2.0。
FAILURE:构建失败并出现异常。
出了什么问题:配置项目 ':app' 时出现问题。
未找到 SDK 位置。使用 local.properties 文件中的 sdk.dir 或使用 ANDROID_HOME 环境变量定义位置。
尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。
通过https://help.gradle.org获得更多帮助
BUILD FAILED in 18s Exited with code 1
这是我的 config.yml 的样子:
# Java Gradle CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-java/ for more details
#
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/openjdk:8-jdk
# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/postgres:9.4
working_directory: ~/repo
environment:
# Customize the JVM maximum heap limit
JVM_OPTS: -Xmx3200m
TERM: dumb
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "build.gradle" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: gradle dependencies
- save_cache:
paths:
- ~/.m2
key: v1-dependencies-{{ checksum "build.gradle" }}
# run tests!
- run: gradle test
【问题讨论】: