Circleci。未找到SDK位置

时间:2018-03-18 13:13:14

标签: android automation continuous-integration continuous-deployment circleci

类似问题中提到的选项对我没有帮助。这就是我在创造问题的原因。

尝试在CircleCi上构建项目时,出现以下错误:

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.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 17s
Exited with code 1

我尝试从此处获取配置文件:https://circleci.com/docs/2.0/language-android/

在构建项目时,我也尝试使用默认配置文件。

我已经设置了ANDROID Home变量,我检查了local.properties文件。一切都是正确的。

有人可以帮忙吗?

我的config.yml文件:

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: Chmod permissions #if permission for Gradlew Dependencies fail, use this. 
       command: sudo chmod +x ./gradlew
      - 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

1 个答案:

答案 0 :(得分:0)

转到应用程序目录->转到android目录->创建一个名为ActionFilterAttribute的文件

然后添加:

RouteData.Values

注意:将sdk地址替换为您的