I have an app which uses Google Services (I'm connecting to Firebase). I now want to set it up with two different flavours - free and paid.
I've done the following in build.gradle:
productFlavors {
free {
applicationId "myname.appname.free"
versionName "1.0-free"
buildConfigField "boolean", "PAID_VERSION", "false"
}
paid {
applicationId "myname.appname.paid"
versionName "1.0-paid"
buildConfigField "boolean", "PAID_VERSION", "true"
}
}
From what I've read, syncing this should cause Android Studio do something that sets up the code to 'have' 2 flavours, is that right? The problem is, it won't sync - I get the error:
Error:Execution failed for task ':app:processFreeReleaseGoogleServices'.
> No matching client found for package name 'myname.appname.free'
Everything I've read seems to suggest that I get around this by adding google-services.json into the 'free' and 'paid' folders, but those folders don't exist - maybe Android Studio would set them up if it completed the sync?
Also, in the Firebase console, I currently have one app: myname.appname - do I need to create two apps in there, called myname.appname.free and myname.appname.paid? And download a different google-services.json for each?