Install repository and sync project makes android studio freeze

I tried to get the latest version of the google play services for the maps api, using compile ‘com.google.android.gms:play-services-maps:11.2.0’ in the gradle file and also put the google maven url in the project gradle.

My problem is that when i try to sync my gradle files, i get an error and android studio proposes to install repository and sync project, but when i click on it nothing happens and android studio freezes for a few seconds.
The same happens if i add the whole google play services with compile ‘com.google.android.gms:play-services:11.2.0’

I tried the invalidate cache/restart technique, i uninstalled/installed the google play service in the sdk manager and i don’t know what to do to resolve this problem.

The build.gradle is like this (it works with the 11.0.4 version) :

apply plugin: 'com.android.application'

def dbflow_version = "4.0.5"

android {
    compileSdkVersion 25
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "not telling"
        minSdkVersion 21
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    annotationProcessor "com.github.Raizlabs.DBFlow:dbflow-processor:${dbflow_version}"
    compile "com.github.Raizlabs.DBFlow:dbflow-core:${dbflow_version}"
    compile "com.github.Raizlabs.DBFlow:dbflow:${dbflow_version}"

    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.squareup.retrofit2:retrofit:2.3.0'
    compile 'com.jakewharton:butterknife:8.8.1'
    compile 'com.google.android.gms:play-services-maps:11.0.4'
    compile 'com.google.android.gms:play-services-location:11.0.4'
    compile 'com.google.android.gms:play-services-identity:11.0.4'
    testCompile 'junit:junit:4.12'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}

Do you have a way to fix this ?