【问题标题】:Could not download groovy-all.jar (org.codehaus.groovy:groovy-all:2.4.15) in Android Studio 3.3 Beta 2无法在 Android Studio 3.3 Beta 2 中下载 groovy-all.jar (org.codehaus.groovy:groovy-all:2.4.15)
【发布时间】:2019-04-06 02:24:02
【问题描述】:

问题:

当我尝试在 Android Studio 3.3 Beta 2 中构建我的 Kotlin 项目的 release variant 时,它会随机卡住 10吐出一些错误后到 16 分钟。

运行gradle/assemble 它显示以下错误:

> Task :app:lintVitalRelease FAILED
:app:lintVitalRelease (Thread[Task worker for ':' Thread 2,5,main]) completed. Took 8 mins 23.222 secs.


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:lintVitalRelease'.
> Could not resolve all files for configuration ':app:lintClassPath'.
   > Could not download groovy-all.jar (org.codehaus.groovy:groovy-all:2.4.15)
      > Could not get resource 'https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.4.15/groovy-all-2.4.15.jar'.
         > Connection reset

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:lintVitalRelease'.

到目前为止我已经尝试过什么

项目 Gradle 设置

android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official


classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.0"
classpath 'com.android.tools.build:gradle:3.4.0-alpha02'
//workaround for Dagger2 > 2.16
classpath 'com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta02'

我不知道是什么导致它停止下载或不允许它下载 groovy 文件,但我被困在这里,无法发布我的应用程序 :(

【问题讨论】:

  • 稳定版 3.2 上会出现这种情况吗?
  • 不,我也无法从那里发布任何东西,它在新项目中也卡在那里,已经超过 10 分钟了。
  • 您使用的是代理,还是网速慢?不同版本的 Groovy 可以工作吗?

标签: android gradle groovy kotlin android-gradle-plugin


【解决方案1】:

当我今天将我的 Android Studio 更新到 ver3.3 时,我遇到了这个问题,这是我的错误:

"Execution failed for task ':app:lintVitalRelease"....    
"org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all artifacts for configuration ':app:debugAndroidTestRuntimeClasspath"

.....

"Could not download junit.jar (junit:junit:4.12)"

.....

"org.gradle.api.resources.ResourceException: Could not get resource 'https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.jar'."

.....

"org.gradle.internal.resource.transport.http.HttpRequestException: Could not GET 'https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.jar'"

.....

这次是 'junit.jar',30 分钟前是 'groovy-all.jar'....我认为我的互联网有问题,所以我试了很多次,等了好几个小时……

但是当我在等待时搜索'任务':app:lintVitalRelease'的执行失败时,我找到了另一个解决方案,将以下行添加到 app\build.gradle

中的 android{}
"lintOptions {
    checkReleaseBuilds false
    abortOnError false
}"

我不知道为什么,但它有效,红线消失了......

【讨论】:

    【解决方案2】:

    我通过等待 30 分钟解决了它,以便它可以下载 groovy jar 文件,然后尝试了 2 小时,我的互联网没有问题。

    感谢@TheWanderer 提示我有关互联网的信息

    【讨论】:

    • 问题应该是jcenter的不稳定,或者它只是拒绝了你的构建环境中的请求,因为你的构建环境请求太频繁了。
    【解决方案3】:

    公认的答案是正确的,只是一件事。对我来说,我使用 VPN,因为我通过安全通道连接到数据库。因此,当我运行 android studio 时,它在类似的点上失败了。一旦我关闭我的 vpn 并再次运行,它就像一个魅力......

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-15
      • 1970-01-01
      • 2023-03-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多