Had this happen mid trip and it turned out not to be the card at all. The little plastic lock tab on the side was loose and the camera thought it was locked. I nudged it toward unlock and put a tiny sliver of thin tape over the channel to keep it from sliding & then reformatted in camera. Worked ever since.
Another thing that bit me was formatting on the computer with the wrong file system. A full format on the computer followed by a format in the camera cleared the error. If the camera still complains, power the camera off, pull the battery for a minute, then try again. Weird, but it can reset the card interface.
If you have any photos you care about on that card, stop writing to it and run recovery on a computer first so you do not make things worse. After that, test with a different card borrowed from someone. If the second card is fine then yours is done. If both fail then the slot or controller in the camera may need service. Hope it is just the tab. Works great.