While you can now install different versions of your app, there's nothing distinguishing them from one another. Also note that buildType s of debug and release are thrown into the matrix of dimensions.
You'll notice that each flavor you add grows the number of variants exponentially. Now that you have defined everything for your build variants in adle, you can open the Build Variants panel in the lower left corner of Android Studio to see what variants are available to build.
Since any application that you build will have at least one flavor from each dimension, you only need to define the applicationId in each node for one dimension. You can get started by going into your project's adle file and adding a flavorDimensions item inside of the android build node.ĪpplicationId ""Įach build that you create will need a unique applicationId in order to differentiate it from the other builds. This enables developers to easily produce multiple similar apps with different styles and configuration. While a standard app may have a debug and release build type, you can expand on this by adding flavor dimensions.įlavor dimensions allow you to use the folder structure of your project to change how individual builds look and act for your users. What Are Build Variants?īuild variants are specific builds that you can produce from Gradle, based around shared core source code. The last item, known as build variants, is what you will learn about in this article. It also allows for easy configuration of project properties and it enables developers to create different versions of their applications in a fairly simple way. Gradle handles dependency management, such as local JAR files, native. While the overall purpose of a build system is to take source code and construct an installable file for your users, an APK in the case of Android, Gradle provides a lot more functionality.
One of the key features of Android Studio is the integration of Gradle as an Android build system.