Search code examples
android-studioandroid-productflavorsgoogle-play-services

Google+ Sign in with flavors


hope someone could help me.

I have my app with different flavors so I can have installed one for test and other for prod at the same time. The thing is that after setting

  test {
        applicationIdSuffix ".test"
        versionNameSuffix "_test"
        resValue "string", "app_name", "MyApp test"
    }

I am not able to log in using a google account if I change my appId. What additional step am I missing in order to my app be able to use the Google Services? I also have my google-services.json under a folder for each flavor and they are working if all of them have the same appId

Thank you!


Solution

  • You need to register a separate app in Google's console with a package name corresponding to your flavor's application id and then use its config in this flavor.