So you may want to synchronize your iChat/iMessage/Messages with Google Talk on your beloved device while the application insists on wrong password even though you double- (or even triple-) checked it is in order. Log review brings cryptic error like: imagent: [Warning] XMPPConnection: Error: Error Domain=XMPPErrorDomain Code=112 “The operation couldn’t be completed. (XMPPErrorDomain error 112.)”. Googling leads nowhere so you probably starts looking around for other messenger app… before you move on though check out if you have right google configuration.
I have to admit I was pissed off loosing another hour without clue what is going on – all other messaging apps (talk on android or IMO on iPad) just worked fine. I tried to check DNS settings of Macbook, setting account details again in Messages app, and removed/reentered whole google account on OSX level. No matter what I have done XMPP errors were popping up in logs.
Later on while reviewing google account settings I found my primary account alias using “googlemail.com” instead of shorter “gmail.com”. I followed guided migration, logged out and logged in back to see if it loads new alias. Suddenly it clicked that it could be the reason of XMPP errors; Google uses “gtalk” and “gmail” names right now as well as they “strongly recommended” migration of email alias. I reopened Messages app once again and… IT WORKED!
To prove that was the problem, I moved my alias back to “googlemail.com” for a moment to see again XMPP errors in system log. Going back to “gmail.com” unlocked it again.
I think Google should do better indexing its own issues. Oh, well, that may be deliberate if you remember android/iOS antagonism :]