Global error message: "ERROR CODE: -504" APP CAN'T BE INSTALLED

A

AC Question

Recently my Nexus& 2013 went postal. Long used apps and games would no longer run. I attempted to install security programs and they and other apps were met with the above message. I should note the tablet was rooted, but KING ROOT seems now to have been "disabled." I am sure this is a result of gaming installs although I don't recall when this started happening. The question is what do I do going forward if I'm unable to even run a simple virus on anti-malware tool? Do I set factory resent, Godk forbid?