在尝试在CircleCI上构建项目时,gradle构建期间出现以下错误。这个问题的原因是什么?我正在运行 CircleCI 2.0。
失败:构建发生异常。
出了什么问题:配置项目 ':app' 失败。
未找到SDK位置。在 local.properties 文件中使用 sdk.dir 或使用 ANDROID_HOME 环境变量定义位置。
尝试:运行--stacktrace选项以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。
获取更多帮助:https://help.gradle.org
18秒内构建失败,退出代码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
# - run: # name: Chmod permissions #if permission for Gradlew Dependencies fail, use this. # command: sudo chmod +x ./gradlew
- Ilyabuild
的作业要运行。 如果您希望运行工作流,请检查您的配置是否包含一个名为'workflows:'的顶级键。