Reputation: 761
I want to create different product flavoured and I want to use main application code into created product flavoured.
I have created Two flavoured from this link but I am not able to use my Main application code into created product flavoured.
I have mentioned package structured below and please let me know how can I use it.
I have placed flavoured code inside src folder.
Thanks in advance, And any help will be appreciated.
Upvotes: 0
Views: 76
Reputation: 504
This post explains step by step how to configure your directory structure and gradle file.
The main steps are:
add the product flavours container to the app build.gradle file
productFlavors {
free {
applicationId "antoniocappiello.com.buildvariantsexample.free"
}
paid {
applicationId "antoniocappiello.com.buildvariantsexample.paid"
}
}
create inside src a directory with the exact name of the product flavour that you want to look different from the main variant, for example with the configuration at step 1 the directory name could be paid or free
Upvotes: 1