Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

  • Answer from this question Could not find org.codehaus.groovy:groovy-all:2.4.12 but it isn't downloading at all and getting stuck. status bar while trying to build

  • tried to open the link in the browser and it is downloading the file but it is not downloading while in the build process https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.4.15/groovy-all-2.4.15.jar

  • created a brand new project tried to release it same problem there

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 :(

like image 605
Sim Avatar asked Nov 01 '18 19:11

Sim


3 Answers

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

like image 44
Sim Avatar answered Oct 11 '22 17:10

Sim


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

like image 91
lee mcMcartney Avatar answered Oct 11 '22 18:10

lee mcMcartney


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

like image 1
AbdulMueed Avatar answered Oct 11 '22 17:10

AbdulMueed