When I add my GCM API Key to the Mobile Push add-on in my PubNub Admin Account, why do I get an invalid key error?

It is likely because your GCM API Key is... invalid. To test your key using Google's server, use the following command replace your_gcm_ap_key with your GCM API Key).

curl --header "Authorization: key=your_gcm_api_key" --header Content-Type:"application/json" https://gcm-http.googleapis.com/gcm/send -d "{\"registration_ids\":[\"ABC\"]}"

If the key is invalid, you will get the following response:

<H2>Error 401</H2>

Any other response means the key was valid. If you use the sample registration_ids in the above command, you will get an InvalidRegistration error response but that is because the registration ids are not valid, but the key is.

For more details, see the Google Developers docs, Checking the validity of an API key.