On April 10, 2018, Google deprecated GCM. The GCM server and client APIs were removed on May 29, 2019, and currently any calls to those APIs can be expected to fail.
Google Cloud Messaging, deprecated April 10 2018, has been deactivated and removed from Google's APIs. For equivalent functionality, use Firebase Cloud Messaging (FCM), which inherits the reliable and scalable GCM infrastructure, plus many new features.