Perry Hoekstra
Perry Hoekstra

Reputation: 2773

No matching client found for package name (Google Analytics) - multiple productFlavors/application ids

I am setting up Firebase for my Android application and have run into a slight wrinkle/problem. I have multiple product flavors such as the standard dev, qa and prod. These product flavors share the same application id. However, I have one flavor where the application id is different:

productFlavors {
    dev {
        applicationId "com.acme.myandroidapp"
    }
    qa {
        applicationId "com.acme.myandroidapp"
    }
    foo {
        applicationId "com.acme.foo"
    }
    prod {
        applicationId "com.acme.myandroidapp"
    }

This is causing my gradle build to fail with a "No matching client found for package name 'com.acme.foo'" error.

I have looked at both: No matching client found for package name (Google Analytics) - multiple productFlavors & buildTypes and google-services.json for different productFlavors

Unfortunately, neither question deals with the wrinkle of having a different application id for a particular product flavor. I did try putting a copy of the google-services.json file at the base of each flavor but there was no joy.

Thoughts on how do you support different applicationIds with Google Services under Android?

Upvotes: 1

Views: 4925

Answers (1)

jaede
jaede

Reputation: 859

You can Add app for both the application Ids in Project setting in Firebase Console.

By doing so the new google-services.json file will contain two client-info, 1 for each application ID.

Putting a copy of the google-services.json file at at the base of each flavor should solve the issue.

Upvotes: 2

Related Questions