Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AppCenter React Native Android build failed Could not download groovy-all-2.4.15.jar (org.codehaus.groovy:groovy-all:2.4.15)

* What went wrong: Execution failed for task ':app:lintVitalRelease'. Could not resolve all files for configuration ':app:lintClassPath'. Could not download groovy-all-2.4.15.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'. > Could not GET 'https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.4.15/groovy-all-2.4.15.jar'. > Connection reset

* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

like image 947
Sangeeta Avatar asked Jun 10 '21 05:06

Sangeeta


2 Answers

This happened to me with React Native 0.63 and Flipper version 0.54.

I did this to fix it:

  1. Download groovy-all-2.4.15.jar from https://repo1.maven.org/maven2/org/codehaus/groovy/groovy-all/2.4.15/
  2. Create the folder android/libs (if you don't have it)
  3. Place the .jar file in the folder android/libs (you should check in the .jar file into your repository)
  4. In your root build.gradle, add flatDir:
allprojects {
    repositories {
        google()
        mavenLocal()
        mavenCentral()
        jcenter()
        // ...
+        flatDir {
+            dirs "$rootProject.projectDir/libs"
+        }
    }
}
like image 147
gusgard Avatar answered Sep 17 '22 14:09

gusgard


The way I fixed was by adding mavenCentral() before jcenter. I didn't need to do it in all the node_modules. Just in the build.gradle of the app

like image 29
kingston Avatar answered Sep 20 '22 14:09

kingston