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

Sylvain GIROD picture Sylvain GIROD · Jan 10, 2017 · Viewed 97.8k times · Source

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?

Answer

Vampire picture Vampire · Jan 10, 2017

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.