> For the complete documentation index, see [llms.txt](https://android-course.cornellappdev.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://android-course.cornellappdev.com/chapters/11.-firebase/11.1-setting-up-firebase.md).

# 10.1 Setting up Firebase

### Creating a Firebase Project in the Console

&#x20;To begin, sign in to the [Firebase console](https://console.firebase.google.com). Make sure you use the Google account you want to tie to your project! You should be prompted with a project creation button (or a button to add a project if you've used Firebase before)

![Landing screen for Firebase console](/files/-MYbkHp43nS7FHbUwyXY)

![Create a project screen](/files/-MYblIgDESglOkBkq-US)

### Registering the App With Firebase

Once on the project home page after creating a Firebase project, you’ll notice several options and details. Here’s where you’ll find the option to add Firebase to an app (*hint: click the Android symbol* 😊).

![Project home landing screen](/files/-MYbn7pKdz9nUwr1_qCn)

You’ll see a screen requesting data from your app.

![Add Firebase to your Android app](/files/-MYbmzV3AV_64kRVrequ)

Enter the following information:

* Android Package Name&#x20;
* App Nickname
* Debug signing certificate SHA-1

The Android Package name should be the applicationId in your module level *build.gradle* file.&#x20;

\
The Debug signing certificate SHA-1 key, while optional, is necessary for some services in Firebase (ie certain authentication features and dynamic linking). The SHA-1 key can be retrieved by opening the terminal in Android Studio in your project and running&#x20;

```
gradlew signingReport
```

![Terminal tab highlighted](/files/-MYbp9xwxM7P_o_6OKxf)

### Adding Firebase Configuration Files to Your Android Project

After registering an app, the next screen prompts you to download a JSON file that contains the service configuration for Firebase. Save it anywhere on your computer and remember where you place it. You’ll add it to the project next.

![Landing page for downloading config file](/files/-MYbs5vjkZAIUisb_CYP)

&#x20;Go into Android Studio and switch to the *project view* in the left panel:

![](/files/-MYbstt_zmKcduOM_wK9)

Add the config file directly under \[project name]/app&#x20;

Next, we have to add corresponding dependencies. Switch back to the *Android view* in the same left panel:

![](/files/-MYbuAdKYWXG7Jn0dSQH)

&#x20;Open *build.gradle*, which Android Studio tags as *(Project: \[project name])*. This file is in *Gradle Scripts/build.gradle*.

Next, add this code in the dependencies section:

```
classpath 'com.google.gms:google-services:4.3.3'
```

Then open *Build.gradle*, labeled as *(Module: \[project name])*. This file is also in the *Gradle Scripts* section within the Android view.

Next, add this code under your plugins:

```
id 'com.google.gms.google-services'
```

![](/files/-MYbujstY0M1K2ggZwNK)

Next, add the following under your dependencies in the same gradle file:

```
implementation platform('com.google.firebase:firebase-bom:27.0.0')
implementation 'com.google.firebase:firebase-analytics-ktx'
```

Finally sync!

**`Now celebrate as you've just finished setting up Firebase and the true fun can start ✨✨`**
