I recently ran into an issue with not be able to setup my Apple @me email account on Android phone under the Gmail App. @me.com was the previous domain before it was replaced with @icloud.com. My underlining issue was the Gmail app was not auto-configuring the correct server name. Make sure that the incoming IMAP server is imap.mail.me.com. All other settings and outgoing were correct.
First, you need to generate an app-specific password from Apple ID website. A unique password has to be generated for any non-apple application.
Once you have the password my issue was the autocompleted data was not correct and I kept getting kicked back during account setup in the Gmail app. Error saying settings are not secure. What I found out was the IMAP server was not correct. You need to use imap.mail.me.com for @me accounts.