Open the Firebase Console and click on Add Project.
Start typing the project name that you gave while renaming the project in Google Developers (Google Cloud Platform) console in the previous step. Firebase will suggest you the already created Google Cloud Platform project. Select it and press Continue.
Firebase will now ask you whether you want to enable Google Analytics for your Firebase Projects. Click Continue.
On the Configure Google Analytics screen, select Default Account for Firebase from the dropdown, and click Create project.
Now, click on the Android icon to proceed with adding your app to this Firebase project.
Enter the package name that you assigned to your app and click on Register app.
Click on the Download google-services.json button and once the JSON file gets downloaded, place it inside the app folder of your project directory.
Click on next and it will show you instructions on how to add the Firebase dependencies to your project but these steps have already been implemented in the code by us so you can skip this step and click Next.
Skip the last step as well, by clicking on skip this step. In doing so, you will be redirected to the dashboard. Refresh the page and now your app has been successfully connected to Firebase.
The final thing that you need to do is, go to the Android Studio Menu and click on Build > Rebuilt Project.