-2

I am using Android Studio for android development in a company and here when i am adding any dependency using gradle i am getting "Failed to resolve" error on every gradle dependancy.Please suggest me what is the issue behind this.

Thank you.

Error:(24, 13) Failed to resolve: com.android.volley:volley:1.0.0 Show in File
Show in Project Structure dialog

apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.1"
    defaultConfig {
        applicationId "calkinsmedia.com.myapplication"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:25.1.0'
    compile 'com.android.volley:volley:1.0.0'
}

This is my project level build.gradle :

// Top-level build file where you can add configuration options common to all sub-projects/modules.

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

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
DkThakur
  • 516
  • 2
  • 5
  • 17

1 Answers1

1

Yes, I found the solution.What was the issue,in my system there is a antivirus which preventing the android studio to download dependencies.Once I have turn off the antivirus all working fine.

DkThakur
  • 516
  • 2
  • 5
  • 17