How to use a Different google-services.json file with multiple Product flavors — Android
Different google-services.json file with Multiple Product flavors.
The google-services.json file is usually placed in the app/ root directory of the app module.
Now, in this article, we will learn how to use a
google-services.json file with multiple product flavors, when we have different
google-services.json file according to the need of our project.
How you get the file:
The firebase will help you to download the
google-services.json file when you need to integrate FCM, crashlytics etc..
How to use this file for different product flavors. There are only 3 steps first step is so simple just remove the
google-service.json file from the root of the app/ module and save it your local system directory for the save side, & then make your product flavors like
production folder in the
src folder and put your production
google-services.json file in the root folder of production, like the below screenshot.
staging folder in the
src folder and put your staging
google-services.json file in the root folder of staging, like the below screenshot.
That’s it now sync your project with Gradle files.
If you want to learn more related to Android then check it out the below link: