Google Login for Your App
This guide walks you through adding Google Sign-In to your AI Studio–generated Android app. Your users will be able to sign in with their Google account instead of — or alongside — an email and password. No technical background is required. The whole process takes about 30–60 minutes.
How It Works
Setting up Google Login requires four steps across two platforms — AI Studio and Firebase Console:
Preview vs. Published App
Google Login only works in your published Android app. This is expected behaviour — not a bug:
- Web-based preview — no native Android modules
- Google Login button shows a disabled placeholder: "Available in the published app"
- Layout and all other UI looks exactly as it will in production
- Full native Android build
- Google Login button is live — tapping it opens the account picker
- Firebase Authentication verifies the sign-in server-side
Part 1 — Generate a Release Keystore
A release keystore signs your Android app and produces an SHA-1 fingerprint. Firebase Console needs this fingerprint to trust that sign-in tokens are coming from your app. This step is done once per app.
If you've previously built an APK or AAB, you already have a keystore. Skip to Part 2.
- Log in to AI Studio and open your app from the left sidebar.
- Click the Preview button in the top navigation bar to open the download panel.
- Click "Download APK (For Mobile Testing)" — if no keystore exists yet, the Generate Release Keystore dialog will open automatically.
Fill in: Common Name, Organization, City, State, Country Code (2 letters, e.g. IN), and a strong Password. Click "Generate Keystore".
After generation, AI Studio shows both SHA-256 (for Google Play Console) and SHA-1 (for Firebase Console). Copy and save both now — they cannot be retrieved later.
See the Android App publishing guide for full keystore generation instructions with screenshots.
Part 2 — Set Up Firebase
Firebase Authentication is the service that verifies Google sign-in tokens on the server side.
You need a free Firebase project and a configuration file (google-services.json)
that tells your app which Firebase project to connect to.
You will need your app's Android package name and SHA-1 fingerprint from Part 1. Both are shown in AI Studio Settings → Google Login.
- In AI Studio, click the Settings button in the top navigation bar above the preview.
- Select Google Login in the left menu.
- Under "Step 1 — Use these in Firebase Console", you'll see two values with [Copy] buttons:
- Android package name — e.g.
com.example.myapp - Release SHA-1 fingerprint — e.g.
AB:CD:EF:01:23:...
- Android package name — e.g.
- Click Copy on each — you'll paste these into Firebase Console in the next step.
- Go to console.firebase.google.com.
- Click "Create a project" (or "Add project").
- Enter a project name — e.g. My App Production.
- Choose whether to enable Google Analytics (optional for Sign-In — you can skip it).
- Click Create project and wait for it to provision.
- In the Firebase Console sidebar, click Project Settings (the gear icon next to "Project Overview").
- Scroll down to the "Your apps" section at the bottom of the page.
- Click the Android icon (looks like the Android robot) to add an Android app.
- In "Android package name", paste the package name you copied from AI Studio (e.g.
com.example.myapp). - App nickname is optional — you can leave it blank.
- Click Register app.
After clicking Register app, Firebase shows a "Download google-services.json" step. Do not download it yet. The file at this point does not yet contain the Web OAuth client needed for Google Sign-In — that gets added after you enable the Google provider and add your SHA-1. Click Next → Next → Continue to console to skip past these steps.
The package name you enter here must be identical to the one shown in AI Studio Settings → Google Login. A single character difference will cause a validation error when you upload the file in Part 3.
Firebase needs your app's release keystore SHA-1 to verify that Google Sign-In tokens are coming from your signed app. This is the SHA-1 that AI Studio generated when you created your release keystore — not a debug SHA-1. You add it after the app is registered, not during.
- You should now be back on the Project Settings page. If not, click the gear icon → Project Settings.
- Scroll down to the "Your apps" section — you'll see the Android app you just added.
- Click on your app entry to expand it.
- Under "SHA certificate fingerprints", click "Add fingerprint".
- Paste the release SHA-1 you copied from AI Studio Settings → Google Login.
- Click Save.
The Firebase Console field is labelled "SHA certificate fingerprints" without specifying release or debug. Always use the release SHA-1 shown in AI Studio Settings → Google Login. Using a debug SHA-1 here means Google Sign-In will work in Android Studio debug builds but will fail in your published APK or AAB.
Open AI Studio → Settings (⚙ gear icon next to "Download APP") → Google Login. Your release SHA-1 is shown in the "Step 1 — Use these in Firebase Console" section with a [Copy] button.
- Click Get started if this is your first time opening Authentication.
- Click the Sign-in method tab.
- Click Google in the list of providers.
- Toggle the Enable switch to on.
- Enter a Project support email (your email address — shown to users on the Google consent screen).
- Click Save.
Now that you have added your SHA-1 fingerprint and enabled Google Sign-In,
the google-services.json file contains everything it needs.
Download it now — this is the file you'll upload to AI Studio in Part 3.
- Click the gear icon → Project Settings.
- Scroll down to "Your apps" and click on your Android app.
- Click google-services.json → Download.
- Save the file — you'll upload it to AI Studio in the next part.
Always download google-services.json after you have: (1) added your release SHA-1 fingerprint and (2) enabled Google in Authentication → Sign-in method. If you download it before either of these steps, the file will be missing the Web OAuth client — Google Sign-In will fail at runtime.
Part 3 — Upload google-services.json in AI Studio
With your google-services.json ready, upload it to AI Studio.
The system will parse the file, validate the package name, and securely store the configuration.
You do not need to copy-paste any client IDs or project IDs manually.
- Open your app in AI Studio.
- Click the Settings button in the toolbar above the preview panel (⚙ gear icon next to "Download APP").
- In the left menu, select Google Login.
- Under "Step 2 — Upload google-services.json", click the file picker.
- Select your
google-services.jsonfile (the one you downloaded in Part 2, Step 6 — after adding the SHA-1 and enabling Google Sign-In). - Optional: expand Advanced options to set the email collision policy (see FAQ below).
- Click Save.
AI Studio reads the file and extracts your Firebase project ID, Android package name, and Web Client ID. It validates that the package name in the file matches your app's package name. If they match, the file is stored securely and linked to your next build. If they don't match, you'll see a specific error message explaining how to fix it.
After a successful upload, the page shows a "Currently configured" card with three values — verify they look correct:
- › Firebase project — your Firebase project ID (e.g.
myapp-prod-a1b2c3) - › Android package — your app's package name (e.g.
com.example.myapp) - › Web Client ID — shown masked for security (e.g.
****gh1j.apps.googleusercontent.com)
Part 4 — Build Your Android App
With the configuration saved, the next time you trigger an Android build, AI Studio automatically
injects your google-services.json into the build. You don't need to do anything extra.
📱 APK — For Testing
- Sideload on your Android device
- Test Google Login end-to-end before publishing
- Fastest way to verify the feature works
🚀 AAB — For Play Store
- Required format for Google Play submission
- Google Login is fully live for end users
- Same google-services.json as the APK
We recommend testing with the APK first to confirm Google Login works on a real device before submitting the AAB to Google Play.
- In AI Studio, open the preview / download panel (click the Preview button).
- Click "Download APK (For Mobile Testing)" to test, or "Download AAB (Google Play)" to publish.
- You'll receive an email when the build is ready — typically 5–15 minutes.
You don't need to do anything special in the build step. The build pipeline fetches your saved configuration and includes it in the build. Every new build always uses the latest version of your google-services.json.
- Install the APK on your Android device (see the Android guide for sideloading instructions).
- Open the app and tap Continue with Google.
- The account picker should appear — select your Google account.
- You should be signed in and taken to your app's home screen.
This usually means the SHA-1 fingerprint registered in Firebase Console doesn't match the keystore used to sign the APK. Confirm you pasted the same SHA-1 that AI Studio showed you in Step 2 of Part 1. Then go to Firebase Console → Project Settings → Your apps → SHA certificate fingerprints and check the value matches.
What Your App Users See
Sign-in flow
- User taps Continue with Google on the login screen.
- The Android account picker appears — the user selects their Google account.
- They are signed in and taken to the app's home screen. No email or password required.
If the user already has an email/password account
If a user signs in with Google using an email address that already has an email/password account in your app, what happens depends on the Email Collision Policy you chose when configuring Google Login:
| Policy | What happens | Recommendation |
|---|---|---|
| Auto-link | The Google identity is merged into the existing account. The user can then sign in with either Google or their email/password. | ✅ Recommended for most apps |
| Reject | The user sees a message: "An account with this email already exists. Sign in with your password and link Google from Settings." | Use when you want users to explicitly link accounts |
Signing out
When a user taps "Sign out" in your app, they are signed out of your app's session. This does not sign them out of their Google account on their device — that's a separate action and is intentional (consistent with how all apps using Google Sign-In work).
Account management
If your app is set up with both email/password and Google Login, users who have linked both methods can disconnect Google from their account settings inside your app. Users who signed up with Google only and haven't set a password cannot disconnect Google — they'd have no way to log back in.
Updating or Removing Google Login
Updating your configuration
If you need to update your configuration — for example, to add a new SHA-1 fingerprint or switch Firebase projects —
make the change in Firebase Console first (Project Settings → Your apps → expand your app → Add fingerprint),
then re-download google-services.json and upload it again through
AI Studio Settings → Google Login. The next build will use the updated file.
Removing Google Login
To remove Google Login, go to AI Studio Settings → Google Login and click Remove. This deletes your stored configuration. The next build will no longer include Google Login — the button will no longer appear in your app after publishing the new build.
Before removing Google Login, make sure any users who signed up with Google only (and have no email/password) can still access their account. Consider prompting them to set a password before you remove the integration.
Frequently Asked Questions
No — and this is expected. The in-studio preview is a web build. It doesn't include google-services.json or the native Google Sign-In module. The login screen shows a disabled placeholder button labelled "Available in the published app" so you can still review the layout. Google Login only works in the APK or AAB build.
google-services.json is a configuration file that connects your Android app to your Firebase project. It contains your Firebase project ID, your Android package name, an API key, and an OAuth client ID. None of these values are secret on their own — the API key is restricted by your package name and SHA-1 fingerprint, so it can only be used from your signed app. You do not need to treat this file as a secret. AI Studio stores it securely on its servers and injects it into builds automatically.
The package name inside your google-services.json doesn't match your app's registered package name in AI Studio. To fix it: (1) Open AI Studio → Settings → Google Login and note your app's exact package name. (2) Go to Firebase Console → Project Settings → scroll down to Your apps. (3) Remove the Android app entry. (4) Re-add it using the exact package name. (5) Add your SHA-1 fingerprint to the new entry. (6) Make sure Google is enabled in Authentication → Sign-in method. (7) Re-download google-services.json. (8) Upload the new file in AI Studio Settings.
DEVELOPER_ERROR almost always means the release SHA-1 registered in Firebase Console doesn't match the release keystore that AI Studio used to sign your APK. To fix it: (1) In AI Studio, go to Settings → Google Login — your release SHA-1 is shown there with a Copy button. (2) In Firebase Console, go to Project Settings → scroll down to Your apps → expand your Android app → check "SHA certificate fingerprints". (3) If the value there doesn't match, click "Add fingerprint" and paste the correct release SHA-1 from AI Studio. (4) Re-download google-services.json (the file updates when you add a new fingerprint) and re-upload it in AI Studio Settings. (5) Rebuild your APK.
No — one Firebase project supports both your test APK builds and your production AAB builds, as long as both use the same keystore (which they do in AI Studio). If you want a fully separate staging environment, you can create a second Firebase project and manage the switch manually — but for most apps, a single project is sufficient.
Not in the current version. iOS Google Sign-In requires a different configuration file (GoogleService-Info.plist) and additional setup in Firebase Console for iOS bundle IDs. iOS support is on our roadmap and will be added in a future release.
No. Google Login is included at no extra cost in AI Studio. Firebase Authentication's Google Sign-In is also free for any usage volume under Firebase's generous free tier (Spark plan) — which covers tens of thousands of monthly active users. See Firebase Pricing for details.