Ahhh, I had this problem a while back.
It was an older Samsung tablet, to fix it, I completely wiped the device clean (including the OS) and reinstalled all the necessary files, partitions, and OS back using ODIN.
This wasn't the easiest option but it worked.