Getting Started with Firebase on Android (2026 Setup Guide)

Updated:

This guide shows how to connect an Android app to Firebase in 2026: create a Firebase project, register your app, add google-services.json, apply the Google services plugin and add Firebase libraries with the BoM. It takes about 10 minutes.

Requirements

Step 1: Create a Firebase project

  • Open the Firebase console and click Create a project (or Add project).
  • Enter a name, choose whether to enable Google Analytics, and click Create project.

Step 2: Register your Android app

  • On the project overview page, click the Android icon.
  • Enter your app’s package name – it must match applicationId in app/build.gradle.kts exactly.
  • Optionally add the debug SHA-1. You need it for Google Sign-In and phone auth. Get it from Android Studio’s Gradle panel (Tasks → android → signingReport) or with ./gradlew signingReport.
  • Click Register app.

Step 3: Add google-services.json

Download google-services.json and put it in your app module folder (app/), next to app/build.gradle.kts. Switch the Project panel to Project view to see it.

Step 4: Add the Google services plugin

In the project-level build.gradle.kts:

plugins {
    // ...
    id("com.google.gms.google-services") version "4.4.2" apply false // or newer
}

In the app-level app/build.gradle.kts:

plugins {
    id("com.android.application")
    // ...
    id("com.google.gms.google-services")
}

Step 5: Add Firebase libraries with the BoM

The BoM picks compatible versions for every Firebase library, so you only set one version number:

dependencies {
    implementation(platform("com.google.firebase:firebase-bom:35.0.2")) // check for newer
    implementation("com.google.firebase:firebase-analytics")

    // Add only what you use, without versions:
    // implementation("com.google.firebase:firebase-auth")
    // implementation("com.google.firebase:firebase-firestore")
    // implementation("com.google.firebase:firebase-messaging")
}

Don’t add -ktx libraries. Since July 2025 they are no longer released, and their Kotlin APIs are in the main modules (details).

Step 6: Sync and run

Click Sync Now, then run the app on a device or emulator. If you added Analytics, the Firebase console shows your app as connected after the first launch (it can take a few minutes).

Using Groovy build.gradle instead?

// project build.gradle
plugins {
    id 'com.google.gms.google-services' version '4.4.2' apply false
}

// app/build.gradle
plugins {
    id 'com.android.application'
    id 'com.google.gms.google-services'
}
dependencies {
    implementation platform('com.google.firebase:firebase-bom:35.0.2')
    implementation 'com.google.firebase:firebase-analytics'
}

Shortcut: Firebase Assistant in Android Studio

Tools → Firebase opens the Assistant. Pick a product (for example Authentication), click Connect to Firebase and Add SDK, and it makes the same changes for you. Check the versions it adds afterwards.

Common problems

ErrorFix
File google-services.json is missingPut it in app/, not the project root.
No matching client found for package nameThe package name in Firebase doesn’t match applicationId. Register the correct one and download the file again.
Default FirebaseApp is not initializedThe Google services plugin isn’t applied in app/build.gradle.kts.
Manifest merger failed: minSdkRaise minSdk to 23 or higher.

What to add next

Video tutorial (older setup)

3 Comments

  1. Dong

    Hurrah, that’s what I was exploring for,
    what a information! present here
    at this website, thanks admin
    of this website.

  2. AMAN E ROME
    AMAN E ROMEsays:

    Attribute android:hardwareAccelerated is not allowed here,Attribute android:exported is not allowed hereUnresolved class ‘MainActivity’Attribute android:launchMode is not allowed hereAttribute android:theme is not allowed hereAttribute android:configChanges is not allowed hereAttribute android:windowSoftInputMode is not allowed hereUnresolved class ‘MyFirebaseMessagingService’Attribute android:exported is not allowed here,…. i have these errors in my mainfest xml files

Comments are closed.

WhatsApp us📞 Call now