I recently needed to use Google GCM in my project. From its website it is said:
Firebase Cloud Messaging (FCM) is the new version of GCM. It inherits
In my case, the problem occurs because i had put "apply plugin: 'com.google.gms.google-services'" inside the dependencies of the modules build.grandle insteand of putting it at the end of the file.