I found the solution (which is good because apparently no one else on the internet is of any use for the question, even though it should be obvious). It turns out that Google blocks access to your account if it's being accessed from a third party that isn't up to their security standards. They even send you an email telling you they're blocking the third-party app, and they give a message saying the password or login is incorrect. What you have to do is go to google.com/settings/security/lesssecureapps and then click "allow". After I did that it worked fine. I immediately went back and turned off access after I logged in though, because they have a point, if you allow third-party access at all time it comes with a huge risk because apps are easily hacked.