

Click here to see list of all the properties and methods that can be configured inside default config and flavor block (or groovy closure). In the above example, some properties are overwritten in flavor blocks and the rest are inherited from default config block. Here is a sample skeleton:ĪpplicationId " 1"ĪpplicationId " 2" Each product flavor can override the properties and methods defined in default config block. This means that everything that goes inside a default config block can go inside a flavor block. Default config block also uses ProductFlavor DSL (domain specific language) object. Whatever properties and methods are defined in default config are inherited by all product flavors. Now, we all know about default config, we specify properties like minSdkVersion, versionCode etc. Click here to see ProductFlavor DSL (domain specific language) object that is used to configure flavor specific properties and methods. Inside these flavor blocks are flavor specific properties and methods like applicationId (the app package name), versionCode, buildConfigField etc. So now there will be 6 build variants: flavor1-debug, flavor1-release, flavor2-debug, flavor2-release, flavor3-debug and flavor3-release. By default, Android has 2 debug types called debug and release (more can be added like jnidebug), a build variant or variant is a combination of build type and product flavor. By writing this, we have created 3 flavors called flavor1, flavor2 and flavor3.

As you can see, this skeleton goes in Android block in adle file.
