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
build application product flavor want default.
remove
apply plugin: 'com.google.gms.google-services
app/build.gradle
. plugin reads values ingoogle-services.json
, copies them on compile time in xml values file. manually in step 4.create new (or use existing) xml values file in main folder.
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.delete
google-services.json
now credentials default application used , don't need initialise way mentioned in previous answer
Comments
Post a Comment