Integrating Firebase CLI with Android Studio for Flutter Development

in flutter •  6 days ago  (edited)

Hello everyone!

If you want to integrate Firebase with your Flutter app efficiently then you are at the right place. This step-by-step guide will walk you through setting up Firebase CLI in Android Studio from project creation to command-line installation and authentication. By the end you will have Firebase fully integrated into your Flutter app. It will be ready to use powerful services like Firestore, Authentication, and Cloud Functions provided by the firebase.


Designed with Canva

Let us start:

image.png

First of all go to the firebase console to create and add a new project which you want to integrate with the flutter and firebase.

image.png

Then simply click on the create new project for the creation of the firebase project to handle it with the flutter development.

image.png

Then we need to add the name of the project. The name should be unique and it should not similar to any other project in the firebase.

image.png

Here you can enable the google analytics if we allow it, it will monitor the application. These analytics help in the issue submission, cloud messaging, In-app messaging, remote configuration, A/B testing and cloud functions.

image.png

Now here if you are using Google Analytics you have to accept the terms and conditions of the Google analytics. While accepting the terms and conditions you have to choose the location of the analytics. It is not the location for which the analysis will be collected but it is the region which will be used to store the collected data. You can select any suitable region for your app.

image.png

After accepting all these terms and conditions and setting up the previous things and while clicking on the submission button it will take some time in the processing. And after the completion of the process the project will be created.

image.png

Here you can see the project has been created with my given name. The name should be unique.

image.png

Here we have to select our preferred operating system for the application to run in this created project. As currently I am going to develop an android application so I have selected Android you can select any of these options. Follow the steps and your project will be added to your android application.

image.png

Now in order to use in in the system we need to run the command in the terminal as shown to install the firebase tools in the editor to use it through the Firebase CLI which is the easiest way to integrate it.

image.png

After the completion of the installation we see a message like this. It is saying 634 packages were added in the editor and it took around 2 minutes of time.

image.png

Now in order to confirm the instaltion of firebase_tools run this command firebase --version. If it returns the version of the firebase then it is sure it has installed correctly.

image.png

Now to login your firebase run this command firebase login. It will require some permissions from the system and you have to allow these permissions. The permission pp up is showing above.

image.png

After running the login command it will open the browser which will require your accounts authentication to login it and use it in the android studio or in any other code editor on which you are working.

image.png

Select your account in which you already made the firebase account and the project.

image.png

Now accept the terms and conditions and allow the permissions to firebase. These permissions include edit, configure, delete and more.

image.png

After this you will see a pop up message like this that login is successful. In this way we can login using the firebase command line tool.

image.png

Now we need to choose the functions and features for our project to add in the application. In order to choose the sevices for our application we need to run the command firebase init. This will initialize the firebase in the terminal. You can see in the above picture all the services and we can choose which suits our project the best.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order: