1

Is it possible to add Flavors to the new version of an already published App? If yes, suppose the following senario: I have a published app in Play Store (e.g. com.example.android). In the new version of the app I add (e.g. free and paid) Flavors. This addition changes the package name of the app to com.example.android.free and com.example.android.paid. Suppose I publish only the com.example.android.free Flavor. What will the link to the Play store be like?

https://play.google.com/store/apps/details?id=com.android.example (as it already was) or it will be renamed to https://play.google.com/store/apps/details?id=com.android.example.free

Fivos
  • 558
  • 8
  • 19

2 Answers2

3

Just to be clear on the answer by marmor:

You CAN create flavours after you have a published application. But if you wish to keep the app published and updatable on Play Store that same app MUST have the original package name which means that it has to be one of the flavours created AND its package name left untouched.

As an example, imagine that you have one published app and then you decide that you want a FREE and a PRO version of it. You change your build.gradle file to have two flavours:

defaultConfig {
    applicationId "com.mycompany.awesomeapp"
    minSdkVersion 21
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
}
flavorDimensions "feature"
productFlavors {
    free{

    }
    pro{
        applicationIdSuffix ".pro"
    }
}

Now what this means is that the original app in the store is now the FREE product flavour and you can sign it and update it to the Play Store. You can even change its name. What matters is that its package name remains the same, in this case

com.mycompany.awesomeapp

which is the default defined and that uniquely identifies your app.

The PRO version is a different app now that you can publish and update as a new app. Its package name is now

com.mycompany.awesomeapp.pro

Meaning it is a new, different app, even though it shares some code base.

CarlosGoncalves
  • 396
  • 4
  • 7
  • This is great. Adding to this, the next step you will probably want to do is create the files for this "pro" version. The basic idea is that your "main/res/layout" file structure will be replicated so that you have another structure of "pro/res/layout". You will create this structure for "pro/java/..." and any unique files you will want in this "pro" version. These are known as "source sets" which you can read about here: https://developer.android.com/studio/build/build-variants#sourcesets – Nick Dev May 07 '20 at 16:35
2

You can't change the package name of an already published app, you can however have two flavors free/paid, but one of them should have the original package name: e.g.

free = com.example.android
paid = com.example.android.paid

which will mean the free app would update the currently existing one, and the paid app will be a new app on Google Play (with zero statistics and downloads).

the links to the 2 apps would be as expected: https://play.google.com/store/apps/details?id=com.android.example and https://play.google.com/store/apps/details?id=com.android.example.paid

If you want to enjoy the best of both worlds, look into [in-app-billing][1] to allow your users to download the app for free, and pay within the app to unlock premium features.

marmor
  • 27,641
  • 11
  • 107
  • 150