What's the latest method to fetch Gmail addresses on Android devices in 2025?

Hey everyone! I’m scratching my head over this one. I’ve been trying to get the user’s Gmail address on Android, but the old methods don’t seem to work anymore. I’ve looked at some older posts and they suggested using AccountManager and GET_ACCOUNTS permission, but I’m not having any luck. The accounts array always comes up empty.

I’ve got the permission in my manifest file:

<uses-permission android:name="android.permission.GET_ACCOUNTS" />

And here’s what my app’s build file looks like:

android {
    compileSdk = 34
    defaultConfig {
        minSdk = 28
        targetSdk = 34
    }
}

I’m testing on my actual phone with multiple accounts, not just the emulator. Has anyone found a working solution for this in 2025? The privacy rules keep changing and I’m not sure what’s the current best practice. Any help would be awesome!

yo, i feel ur pain! google’s constantly changing stuff. have u tried the AccountPicker API? it’s a bit roundabout but might work. u gotta prompt the user to pick an account, then u can grab the email. not ideal but better than nothin. good luck mate!

I’ve been grappling with this issue too. From my experience, the landscape for accessing Gmail addresses on Android has shifted dramatically due to privacy concerns. One approach that’s worked for me is integrating the Google Identity Services library, which provides a user-friendly and compliant solution.

I updated my app’s build configuration to include the necessary dependency, set up the OneTapClient for a smooth sign-in experience, and ensured that the email scope was properly requested. This approach respects user privacy by explicitly asking for permission and is a more future-proof solution. It takes a bit more effort up front, but it reliably handles the privacy changes. Remember to design for scenarios where users might not opt to share their email. Good luck with your implementation!

I’ve faced similar issues and found that using Google Sign-In is now the preferred method for retrieving Gmail addresses. Instead of relying on legacy approaches like GET_ACCOUNTS, it’s better to prompt the user for authentication and request the email scope. Once the user signs in, you can securely obtain their Gmail address as part of the authentication response. Although setting up Google Sign-In may require some initial effort and integration of the latest library, it complies with current privacy standards and offers a more reliable solution for accessing user account information.