Aman Jain
Aman Jain

Reputation: 3045

Error:Failed to resolve: com.google.android.gms:play-services-measurement:9.2.0

After upgrading Google Play Service to 9.2.0, I am getting this error during a gradle sync.

Error:Failed to resolve: com.google.android.gms:play-services-measurement:9.2.0

How can I resolve this?

Upvotes: 8

Views: 3689

Answers (2)

Michael Katkov
Michael Katkov

Reputation: 2356

Usually, you need to make 4 steps.

  1. Update your local Google Repository. Run Android SDK manager, find Google Repository and update it to the latest version.

  2. In your project level build.gradle add

    dependencies {
        classpath 'com.google.gms:google-services:3.0.0'
        ...
    }
    
  3. In your app level build.gradle add

    dependencies {
       compile 'com.google.android.gms:play-services-gcm:9.2.0'
       compile 'com.google.android.gms:play-services-measurement:9.2.0'
       //or any google library, which you are interested of
       ...
    }
    
  4. In your app level build.gradle add to the bottom of the file

    apply plugin: 'com.google.gms.google-services'
    

Upvotes: 2

Loki
Loki

Reputation: 982

In the project level build.gradle file, update dependencies to

classpath 'com.google.gms:google-services:3.0.0'

Upvotes: 16

Related Questions