Configuring Android

Adding a google.json file is typically related to integrating Firebase services into a Flutter project. Firebase is a platform developed by Google for creating mobile and web applications. Here’s a step-by-step tutorial on how to add a google.json file to a Flutter project for Firebase integration:

Create a Firebase project

  1. Go to the Firebase console and click “Add project.”

  2. Follow the prompts to create a new project.

Register the app with Firebase

  1. After creating the project, click “Add app” and choose the Android platform.

  2. Follow the instructions to register the app. For Android, we’ll need to provide the package name of our Flutter app. For our case, we’ll use "com.example.educative".

Download google-services.json

  1. After registering the app, we’ll be prompted to download a configuration file named google-services.json for Android. Download this file.

  2. For this case, open the google-services.json in an editor and copy the API keys needed to run the Android widget.

Add google-services.json to the Flutter project

Place the downloaded google-services.json file into the android/app directory of the Flutter project.

Configure dependencies

Open the build.gradle file located in android/app and add the following dependency:

Get hands-on with 1400+ tech skills courses.