Possible solution: Change your gmail password at Google. Details:
My sister just ran into this message on her G Suite (Google apps) account (its just like gmail), both her phone and Mac (running Yosemite or thereabouts) said there was a problem with the server. She could not log in via web either--the web login said her password changed 4 days ago (when the problem started). I (admin) reset her account. Then both Mac Mail and the phone asked for her password (which was not happening before), and entering the new password enabled successful login.
As you are gmail and not G Suite, you have to do your own password reset. I suggest if you can log in via web, change your password, and if you can't log in on web, use whatever recovery options you have set up (usually a phone or second email address). It seems that once the password is changed, the Apple Mail on the phone or Mac notices this and no longer gets stuck with the "not responding" error. Good luck!