Google Play Store Error Code 504
First solution
The usual, please: go to Settings > Apps > All > Google Play Store and Clear cache and Clear data. Also Clear cache and Clear data for Google Services Framework.
Second solution
Try removing your Gmail account
Google Play Store Error Code 505
Solution
You need to find that whatapps has that some permission and trying to install & uninstall problems app.you find apk file for the trying to install and restore app and using a backup.
Google Play Store Error Code 491
Solution
Remove your Google account by going to the Settings for your device, then Accounts and Google. Hit Remove account. Reboot your Android and add the account once again. Next, in the Settings, go to Apps and swipe to All. Scroll down to Google Services, then click Clear data and finally Force stop.