Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle error : Could not find com.android.tools.build:gradle:2.2.3

I'm trying to build my android project using gradle and circleCI, but I've got this error :

* What went wrong:   A problem occurred configuring root project '<myproject>'.   > Could not resolve all dependencies for configuration ':classpath'. > Could not find com.android.tools.build:gradle:2.2.3.  Searched in the following locations:      file:/home/ubuntu/.m2/repository/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom      file:/home/ubuntu/.m2/repository/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar      https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom      https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar      https://oss.sonatype.org/content/repositories/snapshots/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.pom      https://oss.sonatype.org/content/repositories/snapshots/com/android/tools/build/gradle/2.2.3/gradle-2.2.3.jar  Required by:      :<myproject>:unspecified 

Can someone explain me why I've got this problem please?

like image 464
Sylvain GIROD Avatar asked Jan 10 '17 13:01

Sylvain GIROD


2 Answers

It seems the current versions of the Android Gradle plugin are not added to Maven Central, but they are present on jcenter. Add jcenter() to your list of repositories and Gradle should find version 2.2.3. On Maven Central the newest available version is 2.1.3: http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.android.tools.build%22%20AND%20a%3A%22gradle%22. You can also complain to the authors that the current versions are missing on Maven Central.

like image 71
Vampire Avatar answered Sep 20 '22 08:09

Vampire


Reading sembozdemir answer in this post I have resolved a similar problem adding jcenter() in build.gradle (module: cordovaLib)

buildscript {     repositories {         mavenCentral()         jcenter()     }      dependencies {         classpath 'com.android.tools.build:gradle:2.2.3'     }  } 
like image 31
Alessandro Battistini Avatar answered Sep 21 '22 08:09

Alessandro Battistini