Skip to content Skip to sidebar Skip to footer

Android Studio Gradle Not Recognise Com.google.code.gson:gson:2.3.1

Developing app with Android studio using gradle. I have added this dependencies to it: compile 'com.android.support:appcompat-v7:23.0.1' compile 'com.squareup.retrofit:retrofit:1.9

Solution 1:

Define this in you gradle build script.

buildscript {
  repositories {
    mavenCentral()
    jcenter()
  }
  dependencies {
    ...
  }
}

allprojects {
  repositories {
    mavenCentral()
  }
}

Solution 2:

Call mavenCentral() in your build.gradle .

repositories {
    mavenCentral()
}
dependencies {

 compile fileTree(dir: 'libs', include: ['*.jar'])
 compile'com.google.code.gson:gson:2.3' 

}

add maven repository to build.gradle

Failed to resolve: com.google.code.gson:gson:2.3.1

Post a Comment for "Android Studio Gradle Not Recognise Com.google.code.gson:gson:2.3.1"