androidandroid-studioandroid-gradle-pluginandroid-gradle-3.0

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:design:26.1.0


I am getting this error while sync gradle project.

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support:design:26.1.0

can anyone help me?

apply plugin: 'com.android.application' android {
compileSdkVersion 26
defaultConfig {
    applicationId "com.example.phaniteja.sample1"
    minSdkVersion 15
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}  }   dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' }

Solution

  • Unable to resolve dependency for :app@debugAndroidTest/compileClasspath': Could not resolve com.android.support:design:26.1.0 This issue usually happens when the Android Studio is not able to download that dependency.That can be due to many reasons like this Or like in my case where the Maven2 and jcenter repositories are blocked in Company. So what can you do is like check this folder

    Android-sdk\extras\android\m2repository\com\android\support\appcompat-v7

    and check which all versions are available to you in the SDK, use either one of those versions ,So instead of downloading from repository studio will take that lib from SDK.