If you factory reset your device: Set date on your phone to 7th March.
Do the chromecast configuration, should work now.Now you will probably
get the same error as before factory reset when trying to cast.Pull the
plug on the chromecast for 2 second ...