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
- The latest Android Studio.
minSdk23 (Android 6.0) or higher – Firebase’s current minimum (Firebase setup docs).- A Google account to sign in to the Firebase console.
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
applicationIdinapp/build.gradle.ktsexactly. - 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
| Error | Fix |
|---|---|
| File google-services.json is missing | Put it in app/, not the project root. |
| No matching client found for package name | The package name in Firebase doesn’t match applicationId. Register the correct one and download the file again. |
| Default FirebaseApp is not initialized | The Google services plugin isn’t applied in app/build.gradle.kts. |
| Manifest merger failed: minSdk | Raise minSdk to 23 or higher. |
What to add next
- Email and password login with Firebase Authentication
- Save custom user fields in Firestore
- All Firebase tutorials
Video tutorial (older setup)
Keep reading



Hurrah, that’s what I was exploring for,
what a information! present here
at this website, thanks admin
of this website.
welcome:)
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