问题:
当我尝试构建 发布变体 我的 Kotlin 项目在 Android Studio 3.3 Beta 2 ,在吐出一些错误后,它会随机卡住 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.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 执行失败' 当我在等待时,我找到了另一个解决方案,将以下行添加到 安卓{} 在 应用程序\build.gradle
"lintOptions {
checkReleaseBuilds false
abortOnError false
}"
我不知道为什么,但它有效,红线消失了......
关于android - 无法在 Android Studio 3.3 Beta 2 中下载 groovy-all.jar (org.codehaus.groovy :groovy-all:2. 4.15),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53108438/