Post Date: April 22, 2019
Last Updated: October 18, 2026
Introduction
Firebase is a development platform from Google that provides tools and services for building, improving, and maintaining mobile and web applications. It offers features such as Firebase Authentication, Cloud Firestore, Realtime Database, Cloud Messaging, Analytics, and Crashlytics.
Integrating Firebase into an Android application helps developers implement essential backend services without building every component from scratch. If you want to learn how to create a Firebase project, this step-by-step guide will help you create a project, register your Android application, download the google-services.json configuration file, and configure the required Gradle dependencies in Android Studio.
By following this guide, you will understand the Firebase setup process and learn how to connect your Android application to Firebase services efficiently.
Prerequisites
Before starting the Firebase integration process, make sure you have the following:
- Android Studio installed on your computer.
- An Android project created in Android Studio.
- A Google account to access the Firebase Console.
- Your Android application’s package name (application ID).
- An active internet connection.
Note: The original Google Repository installation instructions are outdated. Modern Firebase Android projects generally use Gradle and Google’s Maven repository to resolve dependencies. Follow the requirements of your current Android Studio and Android Gradle Plugin versions.
Step 1: Open Firebase Assistant in Android Studio
Android Studio may provide Firebase integration through its Firebase Assistant, depending on the IDE version and installed plugins.
- Open your Android project in Android Studio.
- Navigate to Tools → Firebase, if available.
- Select the Firebase service you want to integrate.
- Follow the displayed instructions to connect your application to Firebase.
If Firebase Assistant is unavailable or you prefer manual configuration, you can complete the setup directly through the official Firebase Console.
Official website: https://console.firebase.google.com/

Step 2: Create a Firebase Project
Follow these steps to create a new Firebase project:
- Open the Firebase Console.
- Sign in with your Google account.
- Click Create a Firebase project or Add project.
- Enter a name for your project.
- Follow the prompts to configure Google Analytics, if required.
- Review the settings and click Create project.
- Wait for the project to finish provisioning.

Once the process is complete, your Firebase project will be available in the Firebase Console.

Important: A Firebase project ID must be globally unique. Choose it carefully because project IDs generally cannot be changed after the project is created.
Step 3: Register Your Android Application
After creating your Firebase project, register your Android application.
- Open the project overview in the Firebase Console.
- Click the Android icon to add an Android application.
- Enter your Android application’s package name, also known as its application ID.
- Optionally enter an app nickname and SHA-1 or SHA-256 certificate fingerprints when required by the Firebase services you plan to use.
- Click Register app.

You can find the application ID in your app-level Gradle configuration. For example:
applicationId = "com.example.myapp"
Use your application’s actual application ID rather than the example above.
Note: The Android package name must match the application ID registered in Firebase. You cannot change the registered package name for an existing Firebase Android app.
Use your application’s actual application ID rather than the example above.
Note: The Android package name must match the application ID registered in Firebase. You cannot change the registered package name for an existing Firebase Android app.
Step 4: Download the Firebase Configuration File
After registering your Android application, Firebase provides a configuration file named google-services.json.
Follow these steps:
- Click Download google-services.json.
- Save the file to your computer.
- Copy it into your Android application’s app-level directory.
The file should normally be located here:

your-project/app/google-services.json
Make sure the file is not accidentally placed in the project root directory or inside the src directory.
This configuration file provides the Firebase SDK with the project and application information needed to connect to your Firebase project.
Security note: Do not treat google-services.json as a server secret. However, you should configure Firebase Security Rules, API restrictions, and appropriate access controls to protect your application’s data and services.
Step 5: Configure Firebase in Gradle
The next step is to configure the Google Services Gradle plugin and add the Firebase SDK dependencies.
The exact configuration depends on your project’s Gradle structure and version. Follow the current Firebase Android setup guide for the appropriate syntax.
Official documentation: https://firebase.google.com/docs/android/setup
Add the Google Services plugin
For projects using the modern Gradle plugins DSL, declare the Google Services plugin in the project-level Gradle configuration, following the version specified by the current Firebase documentation.
For example, in a Kotlin DSL project, the configuration may look like this:
plugins {
id("com.google.gms.google-services") version "4.4.4" apply false
}
Plugin versions can change. Confirm the current recommended version before using this example.
Next, apply the plugin in your app-level app/build.gradle.kts file:
plugins {
id("com.android.application")
id("com.google.gms.google-services")
}
Keep your existing Android and Kotlin plugins where applicable. Do not replace your entire Gradle configuration with this short example.
Add Firebase SDK dependencies
Firebase recommends using the Firebase Android BoM (Bill of Materials) to manage compatible Firebase library versions.
For example, to integrate Firebase Analytics:
dependencies {
implementation(platform("com.google.firebase:firebase-bom:34.3.0"))
implementation("com.google.firebase:firebase-analytics")
}
This is an illustrative configuration; check the official documentation for the latest BoM version and the correct dependencies for your selected Firebase services.
If you need Authentication, Cloud Firestore, or Firebase Cloud Messaging, add their corresponding Firebase SDK dependencies as documented by Google.
After updating the Gradle files, click Sync Now or use the Gradle sync option in Android Studio.
Step 6: Verify the Firebase Integration
After completing the configuration, verify that your Android application can build successfully.
- Confirm that
google-services.jsonis inside the app-level directory. - Check that the Google Services Gradle plugin is applied.
- Verify that the Firebase SDK dependencies are configured correctly.
- Synchronize the Gradle project.
- Build and run the Android application.
- Open the Firebase Console and check the relevant service dashboard for activity or events.
For Firebase Analytics, event reporting may take some time. Use the appropriate debugging tools if events are not visible immediately.
If Gradle synchronization fails, check your internet connection, repository configuration, plugin versions, and dependency compatibility.
Conclusion
Learning how to create a Firebase project is an important step in integrating Firebase services into an Android application. By creating a Firebase project, registering your Android app, downloading the google-services.json configuration file, and adding the required Gradle dependencies, you can successfully connect your application to Firebase.
Firebase provides powerful tools for authentication, analytics, databases, cloud messaging, and application monitoring, helping developers build reliable and scalable Android applications. To ensure compatibility with the latest Android development tools, always refer to the official Firebase Android documentation.
Follow these steps to simplify your Firebase integration process and start building feature-rich Android applications.
Frequently Asked Questions (FAQs)
1. Is Firebase free to use for Android applications?
Firebase offers a no-cost Spark plan for eligible services, along with a pay-as-you-go Blaze plan. Pricing and usage limits depend on the service and current plan. Review the official Firebase pricing page before deploying your application.
2. Where should I place the google-services.json file?
Place google-services.json in your Android application’s app-level directory, typically your-project/app/google-services.json. Ensure that it corresponds to the correct Firebase project and registered Android application.
3. Why is Firebase not connecting to my Android application?
Common causes include an incorrect application ID, a missing or misplaced google-services.json file, an unapplied Google Services Gradle plugin, incompatible dependency versions, or incorrect Firebase Security Rules. Verify each configuration and review the Android Studio build output for specific errors.
Related Articles
Talk to Our Experts
Need help with Android application development or configuring your Android Studio project? Our experts can help you find the right solution for your business.
Get in touch with us: Contact our team
