Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build product flavors from Android Studio?

I have defined some product flavors in my build.gradle. I am able to successfully build them using gradlew.

I can't figure out how I do so from the Android Studio IDE.

(My project was initially done in Eclipse then I've migrated to the Android Studio)

like image 231
Alexander Kulyakhtin Avatar asked Oct 07 '13 20:10

Alexander Kulyakhtin


People also ask

How do you make flavors on Android?

To write flavor specific code, create the folder with the same name as the flavor. The java classes with the same name in the flavor folders won't override the main folder. The res folder in the main should only have those directories that are common to all flavors.

What are build variants in Android?

Build variants are the result of Gradle using a specific set of rules to combine settings, code, and resources configured in your build types and product flavors. Although you do not configure build variants directly, you do configure the build types and product flavors that form them.

What is Flavour dimension android?

The flavor dimensions define the cartesian product that will be used to produce variants. Example: flavorDimensions("dimA", "dimB") productFlavors { row1 { ... dimension = "dimA" } row2 { ... dimension = "dimA" } row3 { ... dimension = "dimA" } col1 { ...

Where is build variants in Android Studio?

To change the build variant Android Studio uses, select Build > Select Build Variant in the menu bar. For projects without native/C++ code, the Build Variants panel has two columns: Module and Active Build Variant.


1 Answers

Build Variants appears as a vertical button along the bottom of the left edge of the workspace. If it's not visible, click the little rectangle icon on the lower left corner.

like image 116
Krylez Avatar answered Sep 18 '22 15:09

Krylez