首页 > 解决方案 > Android lint 在 Gitlab Runner (Docker) 上失败

问题描述

我有一个运行 AndroidlintDevDebug任务的 Gitlab 运行器(Docker Executor)。Gitlab 运行器在 GCP 上运行。尝试下载时作业失败groovy-all-2.4.15.jar。我可以wget在同一个 lint 作业中的 .gitlab-ci.yml 文件中的 jar 文件,并且那里没有连接问题。我在使用jCenter()获取罐子时遇到了同样的问题。在lineDevDebug本地机器上没有任何问题。工作中的其他任务在.gitlab-ci-ymlCI 上没有任何问题(例如assembleDebug等)。任何帮助将不胜感激。

错误是:

> Task :app:lintDevDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:lintDevDebug'.
> Could not resolve all files for configuration ':app:lintClassPath'.
   > Could not download groovy-all-2.4.15.jar (org.codehaus.groovy:groovy-all:2.4.15)
      > Could not get resource 'https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-all/2.4.15/groovy-all-2.4.15.jar'.
         > Could not GET 'https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-all/2.4.15/groovy-all-2.4.15.jar'.
            > Connection reset

这是 .gitlab-ci.yml 文件

image: ghcr.io/alvr/alpine-android:latest-jdk8

before_script:
  - chmod +x ./gradlew

stages:
  - build
  - test

lintDebug:
  stage: build
  script:
    - ./gradlew --info -Pci --console=plain :app:lintDevDebug -PbuildDir=lint
  tags:
    - android-runner

标签: androiddockergroovygitlab

解决方案


推荐阅读