Android Studio - nested flavors (Gradle)

I am trying to create different APKs for the free and paid version (removed ads in layout files), in addition, I want to track Google Analytics downloads from different stores (Google Play, Amazon, etc.).

In a directory tree, it will look like this:

\
\[free]
       \[amazon]
       \[googleplay]
       \common part for free app
\[pro]
      \[amazon]
      \[googleplay]
      \common part for paid app

      

Is it possible to have build options like this with Gradle build? If not, what would be your suggested solution. I know I can prepare flavors in a flat structure (amazonfree, amazonpro, googleplayfree, googleplaypro), but some of the code will have to be duplicated.

+3


source to share


1 answer


flavorDimensions is what you are looking for. One aspect would be the price for you (free / paid) and another dimension would be the store (play / amazon / ..)



+3


source







All Articles