android - How can I make multiple app flavors use the same google-services.json file? -


i have 1 google-services.json file, 1 application id, connected 1 firebase "app" in 1 firebase "project," used variety of flavors of android app.

my flavors branded differently, work same, , want analytics data of them end in same place in firebase. however, (of course) have android application ids/package names suffixed differently, , none of flavor package names match 1 in google-services.json, doesn't have suffix @ all.

i've seen many ways connect different flavors of android app different firebase "apps" in same firebase "project," that's not want do: want connect different android app flavors same firebase "app."

is there way firebase, or should elsewhere?

thanks, dan wiebe

indeed previous answer not enough answer question i've created step step guide.

step step

  1. build application product flavor want default.

  2. remove apply plugin: 'com.google.gms.google-services app/build.gradle. plugin reads values in google-services.json , copies them on compile time in xml values file. manually in step 4.

  3. create new (or use existing) xml values file in main folder.

  4. go app/build/generated/res/google-services/{productflavor}/debug/values/values.xml , copy values values xml created in step 3. replace {productflavor} product flavor selected step 1.

  5. delete google-services.json

now credentials default application used , don't need initialise way mentioned in previous answer


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -