Vikas Pandey
Vikas Pandey

Reputation: 1235

managing google service json for multiple build variant with different application ID

In my project, there is 2 build type debug and release as usual and one flavour dimension with 3 different values flavour_1, flavour_2 and flavour_3, so earlier all build variant has the same application id and only one variant can be installed in a device.

Now We need all variants to have different application IDs so that different variants can be installed on a device, so I have added an applicationIdSuffix. Now I am getting error while building because googleServiceJson file does not have information for other applicationId and I am getting the error -

Execution failed for task ':app:processProdDebugGoogleServices'.

No matching client found for package name 'com.x.y.prod.debug'

what are my option to resolve this? one way seems to be that I have to create multiple project for every build variant and have application id information there and have the google service json file in my project.

Is it possible to have all the application Id information in only one project.

Upvotes: 1

Views: 4165

Answers (1)

Ernis A.
Ernis A.

Reputation: 150

  1. Create folder for each flavor in our project src directory: app/src/flavor_1, app/src/flavor_2, app/src/flavor_3
  2. Create Firebase project for each application ID
  3. Put each generated google-services.json inside those flavor folders, the structure should be as follows: app/src/flavor_1/google-services.json

More details in Configure build variants

Hope to helps!

Upvotes: 0

Related Questions