Search code examples
androidandroid-studiogradleandroid-productflavors

When creating Product Flavors in Gradle in Android Studio, how is the main module used?


I see that the Main module is automatically created when you create new product flavors in Android. Is it possible to rename Main or must it be named Main?

Also, if you are only supposed to put code that differs from Main in the respective flavor folders, is it possible for Main to be completely empty?


Solution

  • It does not make much sense to leave your main flavor empty. If you want two flavors that differ in all files, just create a new project or module. You shouldn't rename main as most of the toolchain relies on the main flavor beeing called "main". If you want an anser for your specific use case, please describe your use case!