0

the error says :

Unable to resolve dependency for ':app@Debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:28.0.0. Open File Show Details

Unable to resolve dependency for ':app@Debug/compileClasspath': Could not resolve com.android.support:support-v4:28.0.0. Open File Show Details

Unable to resolve dependency for ':app@Debug/compileClasspath': Could not resolve com.android.support:design:28.0.0. Open File Show Details

And my project gradle is as below :

buildscript {
    repositories {
         maven {
             url 'https://maven.google.com'
         }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        maven {
                 url 'https://maven.google.com'
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

And the app gradle contains following compile and target sdk versions :

compileSdkVersion 28
flavorDimensions 'versionCode'
defaultConfig {
    minSdkVersion 14
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
}

And following dependencies

dependencies {
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:design:28.0.0'
}
Rodrigo Paixão
  • 246
  • 5
  • 12

1 Answers1

0

See the solution here: https://stackoverflow.com/a/51151050/8034839

Basically, it is to add google() as the first repository for your

allprojects {
    repositories {
        google() //here
        maven {
                 url 'https://maven.google.com'
        }
    }
}

and

buildscript {
    repositories {
         google() //here
         maven {
             url 'https://maven.google.com'
         }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
shizhen
  • 12,251
  • 9
  • 52
  • 88