0

So I have an app that would require to versions with different settings, assets etc but uses the same code base so it will generate two apks. I really have no idea how to do it in gradle. can anyone please point me to a site or a technique in which i can do this? thanks.

klambiguit
  • 527
  • 1
  • 3
  • 14
  • Please check this stackoverflow post: http://stackoverflow.com/questions/19461145/gradle-flavors-for-android-with-custom-source-sets-what-should-the-gradle-file – sider Aug 11 '15 at 20:39
  • Grade is very good for this. The term your looking for is "build varient" – Richard Tingle Aug 11 '15 at 20:39

1 Answers1

1

Start witch adding product flavors to your build.gradle script and set proper ids

productFlavors {
        appOne{
            applicationId 'com.app.one'
              }

        appTwo{
            applicationId 'com.app.two'
              }
}

When that's done create folders in your src directory called

appOne and appTwo. In those folders you can specify version specific stuff like drawable folders, manifest...

When that's done, remember to choose right build variant in buildvariants menu

Adam Fręśko
  • 1,064
  • 9
  • 14