Samsung's IT support team sent me this solution when I enquired about a warrenty claim around this issue:
Clear the data of the 'USBSettings' app (or similar). To clear an app's data go to:
Hope this helps
I'm getting this same error. My phone hasn't come into contact with any water. I've tried the unplug restart plug dance and cleaning out the charging port with a q-tip but it's rather small. I also tried switching to a wireless charger but the water warning seems to still prevent charging. Please just disable this freaking warning.