I have two google-services.json
files one for Google Sign-In another for Firebase storage, how can I put two files in same project. Please help me to solve this. I already have integrated Google Sign-In in my app,Now I downloaded JSON file for storage but couldn't put it in same project.
There is no way to use two google-services.json files in a single Android app. The file name is the same between them and they need to be in the same location. So one will overwrite the other in that case.
However all that happens with google-services.json is that it is auto-parsed when you create a FirebaseApp
. You can also specify the information needed for a FirebaseApp
explicitly in your code. So by doing that you can access two Firebase projects from a single app. For an example of how to do that, see my answer to How to connect to more than one firebase database from an android App.
Another option would be to manually merge the two google-services.json files. However I recommend against that, as you're likely to overwrite the manually merged file with a new version at some point.
The final option (and the one I recommend) is to bite the bullet and migrate the files from the older Firebase project to the new one. That way you'll only need one google-services.json going forward.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With