Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error:(23, 13) Failed to resolve: com.google.android.gms:play-services:11.2.0 "Install Repository and sync project" dose not work

I am trying to get location and update to server in my Android app. This is my Gradle code, here I included compile 'com.google.android.gms:play-services:11.2.0'. This line is from the documentation:

dependencies {
    compile 'com.google.android.gms:play-services:11.2.0'

    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:support-v4:25.3.1'       
}

But this is the error I get:

Error:(23, 13) Failed to resolve: com.google.android.gms:play-services:11.2.0
Install Repository and sync project
Show in File
Show in Project Structure dialog

Clicking in "Install Repository and sync project" doesn't work.

like image 536
Mahidul Islam Avatar asked Aug 15 '17 07:08

Mahidul Islam


1 Answers

Add this to your project-level build.gradle file:

repositories {
    maven {
        url "https://maven.google.com"
    }
}
like image 76
Saurabh Thorat Avatar answered Oct 22 '22 14:10

Saurabh Thorat