UPDATE:
In Android studio 3.0 the error is solved.
Or you can add google()
to solve it since you will use new the gradle plugin as mentioned here.
buildscript {
repositories {
...
// You need to add the following repository to download the
// new plugin.
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
}
}
Before Android studio 3.0:
Check if the support library is installed in your system (check the SDK directory in your system) or check if Android O is installed in the SDK Manager.
Or as this answer stated
Starting from version 26 of support libraries make sure that the repositories section includes a maven section with the "https://maven.google.com" endpoint.
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}