Ivan Arnie Ivan Arnie - 2 months ago 13
Android Question

Android Studio graddle 2.1.3 issue

Gradle Issue in Android Studio 2.1.3

I got those errors when i run the Desktop application that i've created based on the Tutorial.


where i can find that Gradle 2.1.3? Please help me. Im using Libgdx framework. Thank you in advance.

enter image description here


Error:Gradle: A problem occurred configuring root project 'Flapp Bird'.
Could not resolve all dependencies for configuration ':classpath'.
Could not find com.android.tools.build:gradle:2.1.3.
Searched in the following locations:
file:/C:/Users/Unknown/.m2/repository/com/android/tools/build/gradle/2.1.3/gradle-2.1.3.pom
file:/C:/Users/Unknown/.m2/repository/com/android/tools/build/gradle/2.1.3/gradle-2.1.3.jar

https:://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.3/gradle-2.1.3.
https:://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.3/gradle-2.1.3.jar
https:://oss.sonatype.org/content/repositories/snapshots/com/android/tools/build/gradle/2.1.3/gradle-2.1.3.pom
https:://oss.sonatype.org/content/repositories/snapshots/com/android/tools/build/gradle/2.1.3/gradle-2.1.3.jar

Required by:
:Flapp Bird:unspecified

Answer

The Gradle version 2.1.3 exists, but is not in the Maven central, as said here.

To fix the issue, just add jcenter() after mavenCentral() in your build script.

buildscript {
    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.3'
    }
}
Comments