Sim*_*Sim 5 groovy android gradle kotlin android-gradle-plugin
问题:
当我尝试在Android Studio 3.3 Beta 2 中构建我的Kotlin项目的发布变体时,它在吐出一些错误后随机卡住了 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'.
Run Code Online (Sandbox Code Playgroud)
到目前为止我尝试过的
来自这个问题的答案找不到 org.codehaus.groovy:groovy-all:2.4.12
但它根本没有下载并且卡住了。

试图在浏览器中打开链接,它正在下载文件,但在构建过程中没有下载https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.4.15/groovy- all-2.4.15.jar
创建了一个全新的项目试图在那里发布同样的问题
项目 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'
Run Code Online (Sandbox Code Playgroud)
我不知道是什么导致它停止下载或不允许它下载 groovy 文件,但我被困在这里并且无法发布我的应用程序:(
是的,我通过等待 30 分钟解决了它,因此它可以下载 groovy jar 文件,然后尝试 2 小时,我的互联网没有问题。
感谢@TheWanderer 向我暗示有关互联网的信息。
我想对投反对票的人说一件事,你们对这个平台感到羞耻我是一名经验丰富的开发人员我从来没有在这个平台上给任何人投过票,每个人都来寻求帮助,你们甚至看看我提供的问题细节? 我真的不在乎否决票,但我为真正需要帮助的新人感到同情。/咆哮结束
小智 7
当我今天将我的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"
Run Code Online (Sandbox Code Playgroud)
.....
"Could not download junit.jar (junit:junit:4.12)"
Run Code Online (Sandbox Code Playgroud)
.....
"org.gradle.api.resources.ResourceException: Could not get resource 'https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.jar'."
Run Code Online (Sandbox Code Playgroud)
.....
"org.gradle.internal.resource.transport.http.HttpRequestException: Could not GET 'https://jcenter.bintray.com/junit/junit/4.12/junit-4.12.jar'"
Run Code Online (Sandbox Code Playgroud)
.....
这次是' junit.jar ',而30分钟前是' groovy-all.jar '....我认为我的互联网有问题,所以我尝试了很多次并等了几个小时......
但是,当我搜索“执行失败的任务‘:应用程序:lintVitalRelease ’当我在等待,我发现了另一个解决方案,加上下面几行的Android {}在应用程序\的build.gradle
"lintOptions {
checkReleaseBuilds false
abortOnError false
}"
Run Code Online (Sandbox Code Playgroud)
我不知道为什么,但它有效,红线消失了......
| 归档时间: |
|
| 查看次数: |
7181 次 |
| 最近记录: |