找不到android的sdk,CircleCI – 找不到Android Studio项目的SDK位置
嘗試在CircleCI上構(gòu)建項(xiàng)目時(shí),在gradle構(gòu)建期間發(fā)生以下錯(cuò)誤.這個(gè)問題的原因是什么?我正在運(yùn)行CircleCI 2.0.
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.
>嘗試:使用–stacktrace選項(xiàng)運(yùn)行以獲取堆棧跟蹤.使用–info或–debug選項(xiàng)運(yùn)行以獲取更多日志輸出.
>在https://help.gradle.org獲得更多幫助
在18s建立失敗退出代碼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
解決方法:
CircleCI for Android提供了一個(gè)sample configuration,它可以處理您遇到的SDK問題.我不確定為什么他們?cè)谠O(shè)置新項(xiàng)目時(shí)不會(huì)顯示此選項(xiàng).
基本上,當(dāng)您設(shè)置一個(gè)新項(xiàng)目以遵循CircleCI時(shí),您可能選擇了Gradle(Java)選項(xiàng).這并不專門針對(duì)Android,所以這就是為什么它抱怨缺少SDK.
上面鏈接的示例配置如下所示(最重要的部分是指定的docker鏡像,CircleCI文檔很好地解釋了每行的作用):
version: 2
jobs:
build:
working_directory: ~/code
docker:
- image: circleci/android:api-25-alpha
environment:
JVM_OPTS: -Xmx3200m
steps:
- checkout
- restore_cache:
key: jars-{{ checksum "build.gradle" }}-{{ checksum
"app/build.gradle" }}
- run:
name: Download Dependencies
command: ./gradlew androidDependencies
- save_cache:
paths:
- ~/.gradle
key: jars-{{ checksum "build.gradle" }}-{{ checksum
"app/build.gradle" }}
- run:
name: Run Tests
command: ./gradlew lint test
- store_artifacts:
path: app/build/reports
destination: reports
- store_test_results:
path: app/build/test-results
希望你盡快建立好!
標(biāo)簽:android,circleci
來源: https://codeday.me/bug/20190727/1551060.html
總結(jié)
以上是生活随笔為你收集整理的找不到android的sdk,CircleCI – 找不到Android Studio项目的SDK位置的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: webots使用以及第三方模型导入装配、
- 下一篇: 筛选法求1到100以内的素数