3

I develop two versions of the same app: free and paid one. Both branches based on "master" branch in Git. Sometimes I merge master branch into "free" and "paid" branches to keep them up-to-date. But it is necessary for the free and payed apps to have different package names. Doesn't it confuse git commit history, or may be should I temporary rename package names before app buildings only and keep original package names in Git?

SBerg413
  • 14,515
  • 6
  • 62
  • 88
Scit
  • 1,722
  • 4
  • 15
  • 18
  • Usually people use in-app purchases for these kind of stuff. It helps in promotion and as you confirm payment from server, there's no paid APK distribution online – Sourabh Mar 24 '16 at 21:09

1 Answers1

6

But it is necessary for the free and payed apps to have different package names.

You can handle this in your gradle build file. Just make different flavors. Use the applicationIdSuffix tag to alter the package of either the build or paid app version. For example:

productFlavors {
    free {
        applicationIdSuffix ".free"
    }

   paid {
       // paid package name does not change.
   }
}

Or, you can use the packageName tag to completely alter each build flavor.

productFlavors {
    free {
        packageName 'com.example.product.free'
    }

   paid {
       packageName 'com.example.product.paid'
       }
}
SBerg413
  • 14,515
  • 6
  • 62
  • 88