将Flavors添加到已发布的应用

时间:2016-11-03 12:13:34

标签: android google-play android-productflavors package-name

是否可以将Flavors添加到已发布App的新版本中? 如果是,请假设以下情况: 我在Play商店中发布了一个应用(例如com.example.android)。在新版本的应用中,我添加了(例如freepaid)Flavors。此添加会将应用的包名称更改为com.example.android.freecom.example.android.paid。 假设我只发布com.example.android.free Flavor。 Play商店的链接会是什么样的?

https://play.google.com/store/apps/details?id=com.android.example(已经是) 或者它将被重命名为 https://play.google.com/store/apps/details?id=com.android.example.free

2 个答案:

答案 0 :(得分:2)

您无法更改已发布应用的软件包名称,但您可以使用两种风格free / paid,但其中一种应具有原始软件包名称: 例如

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

这意味着免费应用会更新当前现有应用,付费应用将成为Google Play上的新应用(统计数据和下载量为零)。

指向2个应用的链接将符合预期: https://play.google.com/store/apps/details?id=com.android.examplehttps://play.google.com/store/apps/details?id=com.android.example.paid

如果您想享受两全其美,请查看[in-app-billing][1]以允许您的用户免费下载该应用,并在应用内付费以解锁高级功能。

答案 1 :(得分:2)

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:

val GroupsByP = db.pLinkGroups.collect()
  .groupBy(_.p)
  .map(group => group._1 -> (group._2.map(_.Id -> group._2.map(_.Order)).toSet))

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.