Is there any way to get rid of multiple project information from a google-service json file?

130 views
Skip to first unread message

Nikin Sk

unread,
Jul 10, 2016, 10:42:19 AM7/10/16
to Firebase Google Group
I have two android apps on a single firebase project, when I download the google-service json file it automatically adds both apps information to a single google-service.json file.

Doug Stevenson

unread,
Jul 11, 2016, 8:25:18 PM7/11/16
to Firebase Google Group
Nikin,

This shouldn't cause any problems with your builds.  When you build your Android app, the google services plugin will use only the Firebase project data for the application id (package name) that is currently being built.  The the data for other Firebase projects is ignored.

The reason for having all apps in the same json file is to facilitate building multiple related apps from the same codebase.  So if you have two flavors of apps defined in your build.gradle, you could build them with slightly different Firebase configurations all stored in that single json file.

Doug

Samuel Stern

unread,
Jul 11, 2016, 8:32:12 PM7/11/16
to Firebase Google Group
Nikin,

For some detailed information on exactly how the plugin parses that big JSON file and creates the keys you need, see this documentation:
https://developers.google.com/android/guides/google-services-plugin

To add on to what Doug said, the google-services.json file always includes more information than you need, it basically has all of the non-secret information about your project.  The plugin then chooses what's important to your particular build variant and includes just a few pieces into your app.  So extra information in the file won't affect the size of your APK nor will it pose a security risk (although it's better to keep that file to yourself anyway).

- Sam

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/1c335e31-a1b8-4b1a-97c1-0548d47f894b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages