圆CI "Some errors occurred while attempting to infer information about your code"

CircleCI "Some errors occurred while attempting to infer information about your code"

我正在尝试使用 CircleCI 构建一个 Android 项目,但每次我 运行 构建时,构建都会在 Configure Build 任务中完成并且我收到此消息:

尝试推断有关您的代码的信息时出现一些错误。

此外,当这种情况发生时,CircleCI 会自动尝试重建分支,导致循环,因为每次新构建都会失败。

这是我的 circle.yml 文件

version: 1
machine:
  java:
    version: oraclejdk8
  environment:
    # Java options
    JAVA_OPTS: "-Xms512m -Xmx2048m"
    GRADLE_OPTS: "-Dorg.gradle.daemon=false"

dependencies:
  pre:
    # Install the android packages
    - echo y | android update sdk --no-ui --all --filter "build-tools-25.0.3"

test:
  pre:
    override:
    # Generate a debug-apk
    - ./gradlew assembleAppseeOffDebug -PdisablePreDex

    # Copy the generated apk files to Circle-CI Artifacts
    - cp -r app/build/outputs/apk/ $CIRCLE_ARTIFACTS

    # Copy the test results to Circle-CI Artifacts
    - cp -r app/build/outputs/androidTest-results/* $CIRCLE_TEST_REPORTS

按照 this circle.yml example

解决了问题

1 中,在 test 标签之后有一个 override 标签,但在我的 circle.yml 文件中有一个 pre 标签。删除 pre 标签解决了问题。

最终 circle.yml 文件

version: 1
machine:
  java:
    version: oraclejdk8
  environment:
    # Java options
    JAVA_OPTS: "-Xms512m -Xmx2048m"
    GRADLE_OPTS: "-Dorg.gradle.daemon=false"

dependencies:
  pre:
    # Install the android packages
    - echo y | android update sdk --no-ui --all --filter "build-tools-25.0.3


test: 
  # REMOVED pre TAG
    override:    
    # Generate a debug-apk
    - ./gradlew assembleAppseeOffDebug -PdisablePreDex

    # Copy the generated apk files to Circle-CI Artifacts
    - cp -r app/build/outputs/apk/ $CIRCLE_ARTIFACTS

    # Copy the test results to Circle-CI Artifacts
    - cp -r app/build/outputs/androidTest-results/* $CIRCLE_TEST_REPORTS