Getting the following error while sync gradle, I checked other answers related to similar questions and followed their answers but still getting the same error

Failed to resolve: com.google.android.gms:play-services:15.0.1 Install Repository and sync project Show in File Show in Project Structure dialog

When I click "Install Repository and sync project" then I get following error

Could not find dependency "com.google.android.gms:play-services:15.0.1"

following is app level gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "mpathak.drivetestapp"
        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'
        }
    }
    sourceSets {
        main {
            java.srcDirs = ['src/main/java', 'src/main/java/Entities', 'src/main/java/mpathak.drivetestapp', 'src/main/java/mpathak.drivetestapp/interfaces', 'src/main/java/interfaces']
        }
    }
    compileOptions {
        targetCompatibility 1.8
        sourceCompatibility 1.8
    }
}

dependencies {
    implementation 'com.google.dagger:dagger:2.6'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.6'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7: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'
    implementation 'com.google.android.gms:play-services-drive:15.0.1'
    implementation 'com.google.android.gms:play-services-auth:15.0.1'
    implementation 'com.google.android.gms:play-services:15.0.1'
    implementation 'com.google.android.gms:play-services-identity:15.0.1'
}

and my module gradle (top-level) is as follows

buildscript {

    repositories {
        jcenter()
        maven {url "https://maven.google.com"}
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
        classpath 'com.google.gms:google-services:3.2.0'

        // 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"}
        google()
    }
}

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

I am following the conventions, repo as stated in