Skip to content Skip to sidebar Skip to footer

Androidstudio Gradle Sync Not Correctly Works

I have not included gson-2.3.1.jar to my dependencies on gradle.build file. But it gives me below error when going to sync it. Error:A problem occurred configuring project ':app'

Solution 1:

You don't need to add gson.jar in your libs folder ,just add the below in your dependencies to use gson

compile'com.google.code.gson:gson:2.3.1'

Remove jar file from libs and compile this again

Solution 2:

Try adding this block before your dependencies section in build.gradle

repositories {
        jcenter()
    }

Theoretically this should not be required. But I have faced similar problems without specifying repository.

Solution 3:

get data from jcenter() need some filtering Tunnel ! in Iran for example. use mavenCentral for get retrofit or somethings like this...

add this line in graddle

buildscript {
repositories {

   mavenCentral()

}
dependencies {
    classpath 'com.android.tools.build:gradle:1.5.0'
}
}

allprojects {
repositories {
    mavenCentral()
}
}

Post a Comment for "Androidstudio Gradle Sync Not Correctly Works"