dependencies {
compile fileTree(dir: \'libs\', include: [\'*.jar\'])
androidTestCompile(\'com.android.support.test.espresso:espresso-core:2.2.2\', {
All current editions of Google libraries reside in Google's Maven repository (maven.google.com
), not in the old offline-capable support repositories.
In your project-level build.gradle
file, make sure that your allprojects
closure looks like this:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
or, on Android Studio 3.0+, like this:
allprojects {
repositories {
jcenter()
google()
}
}
I resolved this issue by adding the below in project level build.gradle file.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Even with Android Studio 3.0.+, I had to add this below (not just google()
like @CommonsWare recommended), to get pass the error
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}