首页 > 解决方案 > React 本机 android 构建失败,任务 ':app:lintVitalRelease' 执行失败。无法下载 groovy-all-2..4.15.jar

问题描述

使用 AWS CodeBuild 的 Android 构建失败并出现以下错误:

Execution failed for task ':app:lintVitalRelease'.
> 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

该构建在我的本地机器上运行良好。上述错误仅在尝试使用 AWS CodeBuild 构建 apk 时发生。

如果这与jcenter shutdown 有关,如何解决?

标签: androidreact-nativegroovypipelineaws-codebuild

解决方案


打开您的build.gradle文件并在 android 下添加以下代码:

安卓 {

lintOptions { 
  checkReleaseBuilds false 
}

更多详情在这里


推荐阅读