App Features

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:

🔑
Generate keystore
In AI Studio
🔥
Set up Firebase
In Firebase Console
⬆️
Upload config
In AI Studio Settings
📱
Build your app
APK or AAB

Preview vs. Published App

Google Login only works in your published Android app. This is expected behaviour — not a bug:

⚠ In-Studio Preview
  • 🌐 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
✓ Published Android App (APK / AAB)
  • 📱 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.

💡
Already have a keystore?

If you've previously built an APK or AAB, you already have a keystore. Skip to Part 2.

1 Open the Download section in AI Studio
  1. Log in to AI Studio and open your app from the left sidebar.
  2. Click the Preview button in the top navigation bar to open the download panel.
  3. Click "Download APK (For Mobile Testing)" — if no keystore exists yet, the Generate Release Keystore dialog will open automatically.
2 Fill in the keystore form and generate

Fill in: Common Name, Organization, City, State, Country Code (2 letters, e.g. IN), and a strong Password. Click "Generate Keystore".

⚠️
Save your fingerprints immediately — they are shown only once

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.

📋
Before you start

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.

1 Copy your package name and SHA-1 from AI Studio
  1. In AI Studio, click the Settings button in the top navigation bar above the preview.
  2. Select Google Login in the left menu.
  3. 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:...
  4. Click Copy on each — you'll paste these into Firebase Console in the next step.
2 Create a Firebase project
  1. Go to console.firebase.google.com.
  2. Click "Create a project" (or "Add project").
  3. Enter a project name — e.g. My App Production.
  4. Choose whether to enable Google Analytics (optional for Sign-In — you can skip it).
  5. Click Create project and wait for it to provision.
Open Firebase Console
3 Add your Android app to the Firebase project
  1. In the Firebase Console sidebar, click Project Settings (the gear icon next to "Project Overview").
  2. Scroll down to the "Your apps" section at the bottom of the page.
  3. Click the Android icon (looks like the Android robot) to add an Android app.
  4. In "Android package name", paste the package name you copied from AI Studio (e.g. com.example.myapp).
  5. App nickname is optional — you can leave it blank.
  6. Click Register app.
⚠️
Skip the download prompt on this screen

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 NextNextContinue to console to skip past these steps.

💡
Package name must match exactly

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.

4 Add your release SHA-1 fingerprint to the app

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.

  1. You should now be back on the Project Settings page. If not, click the gear icon → Project Settings.
  2. Scroll down to the "Your apps" section — you'll see the Android app you just added.
  3. Click on your app entry to expand it.
  4. Under "SHA certificate fingerprints", click "Add fingerprint".
  5. Paste the release SHA-1 you copied from AI Studio Settings → Google Login.
  6. Click Save.
⚠️
This must be your release keystore SHA-1 — not a debug SHA-1

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.

📋
Where is my release SHA-1?

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.

5 Enable Google as a Sign-in provider
  1. Click Get started if this is your first time opening Authentication.
  2. Click the Sign-in method tab.
  3. Click Google in the list of providers.
  4. Toggle the Enable switch to on.
  5. Enter a Project support email (your email address — shown to users on the Google consent screen).
  6. Click Save.
6 Download google-services.json

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.

  1. Click the gear icon → Project Settings.
  2. Scroll down to "Your apps" and click on your Android app.
  3. Click google-services.jsonDownload.
  4. Save the file — you'll upload it to AI Studio in the next part.
⚠️
Download order matters

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.

1 Open App Settings in AI Studio
  1. Open your app in AI Studio.
  2. Click the Settings button in the toolbar above the preview panel (⚙ gear icon next to "Download APP").
  3. In the left menu, select Google Login.
2 Upload the file
  1. Under "Step 2 — Upload google-services.json", click the file picker.
  2. Select your google-services.json file (the one you downloaded in Part 2, Step 6 — after adding the SHA-1 and enabling Google Sign-In).
  3. Optional: expand Advanced options to set the email collision policy (see FAQ below).
  4. Click Save.
💡
What happens when you 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.

3 Confirm the configuration is saved

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.

1 Choose the right build type

📱 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.

2 Trigger the build
  1. In AI Studio, open the preview / download panel (click the Preview button).
  2. Click "Download APK (For Mobile Testing)" to test, or "Download AAB (Google Play)" to publish.
  3. You'll receive an email when the build is ready — typically 5–15 minutes.
google-services.json is injected automatically

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.

3 Test Google Login on your device
  1. Install the APK on your Android device (see the Android guide for sideloading instructions).
  2. Open the app and tap Continue with Google.
  3. The account picker should appear — select your Google account.
  4. You should be signed in and taken to your app's home screen.
⚠️
Getting a DEVELOPER_ERROR?

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

  1. User taps Continue with Google on the login screen.
  2. The Android account picker appears — the user selects their Google account.
  3. 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:

PolicyWhat happensRecommendation
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.

⚠️
Users with Google-only accounts will be locked out

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.