Reputation: 505
Anyone knows why the google-services.json for a particular app when downloaded from the console contains details related to other unconnected apps that a developer might have in their firebase account? It makes no sense to list them all in this json used by a totally unrelated app. What's the reasoning behind Google/Firebase doing so and if and how the json can be cleaned up to just have only the data needed for the relevant app?
Upvotes: 0
Views: 26
Reputation: 317808
That's just the way it works. The multiple apps in that file correspond to the multiple apps that you added to the Firebase project.
The idea with putting them all in the same file is that you can use that one file in each of your app builds that are tied to the same project. On Android, sometimes developers have multiple flavors of app builds, each one with a different application ID. In that case, the Firebase plugin will select the correct app from the json with no additional work required.
Having more apps in the file doesn't hurt your build at all. As I mentioned, the gradle plugin will select the correct app from the list using its ID. The others are ignored. There is no need to clean anything up.
If you delete an app from your project using the Firebase console, you can download a new json, and that should no longer have the deleted app in it.
If you are having a specific problem or error that you think is related to the fact that multiple apps are listed, please file an issue with Firebase support, along with reproduction steps.
Upvotes: 1