简体   繁体   中英

Could not download groovy-all.jar (org.codehaus.groovy:groovy-all:2.4.15) in Android Studio 3.3 Beta 2

The Problem:

when i am trying to build release variant of my Kotlin project in Android Studio 3.3 Beta 2 , it is getting stuck randomly for 10 to 16 minutes after spitting some errors.

Running gradle/assemble it showed following errors :

> 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'.

What I've tried so far

Project Gradle settings

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'

i don't know what is causing it to stop downloading or not allowing it to download the groovy file but i am stuck here and can't release my app :(

Yes i solved it by waiting for 30 minutes so it can download the groovy jar file, before trying it for 2 hours and it was no problem with my internet.

thanks @TheWanderer to hint me about the internet .

and i would like to say one thing to down voters you guys are shame to this platform i am an experienced developer i never down voted anyone on this platform every one here comes to get help, do you guys even look at the question details i gave ? i really doesn't care about down voting but i feel for the new comers who really are in need of help. /RANT END

when i updated my Android Studio to ver3.3 today ,i met this problem ,and here are my errors:

"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'"

.....

this time its ' junit.jar ',and 30mins ago its ' groovy-all.jar '....ithink there are sth wrong with my internet,so i have tried many times and waited for hours...

but when i searched ' Execution failed for task ':app:lintVitalRelease ' when i was waiting ,i found another solution,add the following lines to android{} in app\\build.gradle

"lintOptions {
    checkReleaseBuilds false
    abortOnError false
}"

i dont know why,but it works,the red lines disappear...

Accepted answer is right, just one more thing. For me I was using VPN as I was connected to database via secure channel. Hence, when I was running android studio, it was failing at similar point. Once I turned off my vpn and ran again it worked like a charm...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM