Logging in to the Google IMAP server “imap.gmail.com” failed. Make sure the user name and password you entered are correct, then click Continue. If the information isn’t correct, you cannot receive messages.

Does anyone know how to solve this? I've tried some solutions on the internet but they didn't work.

(Yes, my IMAP is turned on)

One thing that my be important, I have set up a phone verification to log in to gmail. (I don't want to turn this off)