Gradle - Error:Failed to find: com.squareup.okhttp:okhttp:2.4.0

1.6k views Asked by At

I just try to use OkHttp but I have the following issue when I sync my gradle file with Android Studio :

Error:Failed to find: com.squareup.okhttp:okhttp:2.4.0

Here is the dependencies part of my build.gradle file :

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:22.1.1'
    compile 'com.google.android.gms:play-services-maps:6.5.87'
    compile 'com.squareup.okhttp:okhttp:2.4.0'
}
1

There are 1 answers

0
Opal On BEST ANSWER

You need to add the following block to the build script:

repositories {
   mavenCentral()
}