I cannot compile instance id for Google Play services

I am trying to add Instance ID (last line)

dependencies { //Basic Google libs compile 'com.android.support:support-v4:+' compile 'com.android.support:appcompat-v7:22.2.0' compile 'com.google.android.gms:play-services-base:7.5.0' compile 'com.google.android.gms:play-services-gcm:7.5.0' compile 'com.google.android.gms:play-services-location:7.5.0' compile 'com.google.android.gms:play-services-maps:7.5.0' compile 'com.google.android.gms:play-services-wallet:7.5.0' compile 'com.google.android.gms.iid:7.5.0' } 

but I keep getting:

Error: Failed to execute: com.google.android.gms.iid: 7.5.0:

Any clue why?

+5
source share
3 answers

There is nothing like this: "com.google.android.gms.iid: 7.5.0" provided by google play services

If you are looking for an identity service, this should be:

 com.google.android.gms:play-services-identity:7.5.0 

Link: https://developers.google.com/android/guides/setup

+6
source

Not sure about version 7.5 but for 10.0.1 just use

 compile 'com.google.android.gms:play-services-iid:10.0.1' 
+4
source

For anyone looking for the InstanceId for the new GCM, Firebase Cloud Messaging, use FirebaseInstanceId instead. WITH:

 FirebaseInstanceId.getInstance().getToken(); 

read more at https://firebase.google.com/docs/cloud-messaging/android/client#sample-register

+2
source

All Articles