Error 504 when downloading apps from Play Store? My device is Motorola Xoom MZ604. The internet connectivity is 4G WiMax via my laptop as hotspot. 
The problem is when I'm trying to download any app from Google Play Store, it gives me an Error 504 with the message I mentioned in title.  

However, if I navigate to the application via browser and click: Install → Select Device → Install and then restart my device, it sometimes works. 

Some googling brought me that it's a gateway timeout error. But I'm still unable to figure out how to work around the problem. So looking forward for your help.
According to the list of status codes at Wikipedia, a 504 error means the following:


  504 Gateway Timeout
  The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.


In other words: the culprit should neither be (on) your device, nor (at) Google Play -- but in between.

A thread on the Nook forum describes the very same problem, and one of the conclusions there is:


  Generally, that means a Gateway error and I would suspect the problem being on the router end rather than the Nook side. Sometimes a router reset will cure it.


Which corresponds to my conclusion. So if you're using mobile data, it might help to switch data off and on again (or better: switch to airplane mode and back), in the hope you will get a connection into a different segment of your provider's network (and thus a different gateway on that end).



From a thread on XDA about all the Google Play Error Codes


  Method 1:   
  
  
  clear data  
  clear cache of google play store &amp; google service framework
  
  
  Method 2:  
  
  
  remove your gmail account 
  reboot 
  Re-add account 
  




Funnily, the very same issue comes to a very different conclusion on Yahoo answers: here the user had not enough space on his device, so after removing some other app it suddenly worked. I suspect this was a co-incidence (when he tried again after having freed up space, the gateway was "fixed") -- but it cannot hurt to check for that.



Several more sulutions might pop up with the time. To me it proved helpful to search Google for '"Google Play" "error 504"'.