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
Well, after struggle a lot I found what was causing my problem. Basically I had two libraries modules - that happened to be of my own - each one of them importing different versions of com.android.support:appcompat-v7.* and google play services. Made all of them import the same version and problem is gone.