I\'ve implemented GCM notifications on my app. I am now trying to un-register the app when the user logs out. I am using the following code. When this code executes, it caus
Update the google play services to the latest version (9.8.0) after updating the android support library to 25.0.0 I had the same problem this morning and this worked for me :)
I was with same problem after update the support library to 25.0.0 . For me after update the below libs,in the app gradle file, the problem gone.
compile("com.google.android.gms:play-services-location:9.6.1")
compile("com.google.android.gms:play-services-maps:9.6.1")
compile("com.google.android.gms:play-services-gcm:9.6.1")
use dependencies in the given way
compile ("com.google.android.gms:play-services-base:10.0.1") {
force = true;
}
compile ("com.google.android.gms:play-services-maps:10.0.1") {
force = true;
}
compile ("com.google.android.gms:play-services-gcm:10.0.1") {
force = true;
}
compile ('com.google.firebase:firebase-core:10.0.1') {
force = true;
}
compile ('com.google.firebase:firebase-messaging:10.0.1') {
force = true;
}
Not sure this will solve your problem, but it's always a good idea to pass the application Context to third party frameworks, rather than Activity instances, as the latter can lead to memory leaks. Try this instead:
InstanceID instanceID = InstanceID.getInstance(getApplicationContext());