Skip to content Skip to sidebar Skip to footer

Gcm Demo Server Sending Message To Device Raises 401 Error

As many other newbies to java and android i'm trying to run gcm demo server and gcm demo client on windows, using eclipse to run vertual device and tomcat as a webserer. I have no

Solution 1:

I just answered a similar question - accessing /gcm-demo/sendAll. Reason: HTTP Status Code: 401

Check the sender API key that you are using.

Solution 2:

I was having this error too,

enter image description here

turns out i hadn't enabled Google Cloud Messaging for Android. (On one of my machines, this was automatically enabled while following the same steps, don't know why it didn't do same on the other) Long story short, go to developers console and enable it.

APIs and Auths | APIs | Google Cloud Messaging for Android

refresh your browser and try again.

Solution 3:

This issue is not addressed well on any of the forum may be because it has multiple causes. My case was: I was doing a demo of GCM push notifications and it worked the first time. But as I proceeded next day with same code i found the exception mention in the answer. On observation, I noticed that my public IP had changed as it is not static. This IP has to be provided when you create project on google developers console. You can find your public IP by searching "my public IP address" in google. Or for demo purpose i would now strongly recommend you to use IP as 0.0.0.0/0 which is recommended and when you deploy your project, your server IP would be static. You can then replace 0.0.0.0/0 IP with your server IP. Also, check all the keys like 'project number' and 'server API key'. Hope it helps. CHEERS :)

Solution 4:

Commons Daemon procrun stderr initialized

If any one is getting this above error try check your jvm.dll path default path located is *C:\Program Files\Java\jdk1.6.0_37\jre\bin\client\jvm.dll* change it to the right path.

Post a Comment for "Gcm Demo Server Sending Message To Device Raises 401 Error"