Issue with adding Volley in Android Studio 3.1.2

I want to add Volley to my project in Android Studio 3.1.2. I’m trying with implementation 'com.android.volley:volley:1.1.0'.

and here’s the Gradle for project:

buildscript {
    ext.kotlin_version = '1.2.41'
    repositories {
         google()
         jcenter()
    }
    dependencies {
         classpath 'com.android.tools.build:gradle:3.1.2'
         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
        mavenCentral()
        maven {
            url "https://maven.google.com"
            name 'Google'
        }
    }
}

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

But it fails with the following errors:

Unable to resolve dependency for ':[email protected]/compileClasspath': Could not resolve com.android.volley:volley:1.1.0.
Open File
Show Details


Unable to resolve dependency for ':[email protected]/compileClasspath': Could not resolve com.android.volley:volley:1.1.0.
Open File
Show Details


Unable to resolve dependency for ':[email protected]/compileClasspath': Could not resolve com.android.volley:volley:1.1.0.
Open File
Show Details


Unable to resolve dependency for ':[email protected]/compileClasspath': Could not resolve com.android.volley:volley:1.1.0.
Open File
Show Details


Unable to resolve dependency for ':[email protected]/compileClasspath': Could not resolve com.android.volley:volley:1.1.0.
Open File
Show Details

and here’s the image of the errors hoping giving better sense of the issue. enter image description here

What I’m missing here?

Answer

It turns out doing Invalidate Caches / Restart does the trick!