Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio gradle 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

like image 434
Ivan Arnie Avatar asked Aug 17 '16 15:08

Ivan Arnie


2 Answers

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'
    }
}
like image 64
manelizzard Avatar answered Oct 04 '22 00:10

manelizzard


No, Ivan is right. The latest version of Android Studio insists on upgrading to Android Plugin for Gradle, Revision 2.1.3 (August 2016), Gradle 2.14.1 or higher and Build Tools 23.0.2 or higher. Studio Message But the moment it does that, it breaks compilation with that error:

Could not resolve all dependencies for configuration ':classpath'. Could not find com.android.tools.build:gradle:2.1.3. Searched in the following locations: 
like image 40
johncougar Avatar answered Oct 03 '22 23:10

johncougar