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

Today I had the same problem. This solved the problem for me:

Open the stand alone Android SDK Manager. In the Extras section the "Google Play Services" were at the latest version, but the "Google Repository" after updating the "Google Repository" from version 33 to 35, the problem was gone.


Finally, I solved it myself. Here is what I did:

  1. Removed compile 'com.google.android.gms:play-services-measurement:9.6.1' and then compiled the project
  2. It gives missing api_key error because GCM got shifted to Firebase and so the google-services.json file does not work
  3. To fix this, simply update the google-services.json file with the new generated file which uses Cloud messaging from Firebase
  4. After this, I compiled and got another error that @drawable/powered_by_google_dark is missing from the project as I am using Places Autocomplete API. To fix this, add compile 'com.google.android.gms:play-services-places:9.6.0' to dependencies

You don't have the latest google play services, just click the link and android studio will offer a dialog to install it.