Defining product flavors

suggest change

Product flavors are defined in the build.gradle file inside the android { ... } block as seen below.

...
android {
    ...
    productFlavors {
        free {
            applicationId "com.example.app.free"
            versionName "1.0-free"
        }
        paid {
            applicationId "com.example.app.paid"
            versionName "1.0-paid"
        }
    }
}

This defines two product flavors, free and paid. Each can have its own configuration. Here each flavor sets its own applicationId and versionName. The main source set is not a flavor. It is shared by every variant.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents