android - circleci # Unable to parse YAML # mapping values are not allowed here

标签 android continuous-integration circleci-2.0

我需要在 CriclCi 中构建我的 Android 应用程序.我刚找到一个 provided sample如下所示:

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: # for display in Artifacts: https://circleci.com/docs/2.0/artifacts/ 
          path: app/build/reports
          destination: reports
      - store_test_results: # for display in Test Summary: https://circleci.com/docs/2.0/collect-test-data/
          path: app/build/test-results
      # See https://circleci.com/docs/2.0/deployment-integrations/ for deploy examples

但是,当我使用它时,CircleCi 构建失败并提示:

#!/bin/bash -eo pipefail
./gradlew androidDependencies
/bin/bash: ./gradlew: Permission denied
Exited with code 126

因此,我添加了以下代码并再次尝试:

  run:
         name: Chmod permissions
         command: sudo chmod +x ./gradlew

此代码由 CCI 推荐,但这次它提示:

#!/bin/sh -eo pipefail
# Unable to parse YAML
# mapping values are not allowed here
#  in 'string', line 13, column 16:
#               - run:
#                    ^
# 
# -------
# Warning: This configuration was auto-generated to show you the message above.
# Don't rerun this job. Rerunning will have no effect.
false

我该如何解决?

最佳答案

我明白了,yml 文件中的缩进应该始终保持不变。 因此,run 关键字应始终位于同一列中。

关于android - circleci # Unable to parse YAML # mapping values are not allowed here,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54958949/

相关文章:

android - 如何在 AOSP 源中将系统音量设置为最大

ios - Travis CI 问题 : Couldn't find the specified scheme in the mentioned workspace

angular - 如何使用 Angular CLI 生成源映射并将它们上传到 Sentry?

IDE之外的Java连续测试

circleCI CLI - 在配置文件的 `build` 部分找不到名为 `jobs:` 的作业要运行

python - 使用特定 Miniconda Python 和 NumPy 版本进行 CircleCI 测试

docker - 如何在通过 CircleCI 运行的 Ubuntu 中启动 Redis

android - 同时进行语音转文本和文本转语音

android - 如果方法使用不重叠,2 个 Activity 是否应该有单独的 ViewModel?

android - 自定义微调器动画不够流畅 : framesCount and frameDuration error