![]() ![]() You can use the Gradle build files to specify unique Manifest entries for each build variant, which will then be inserted into your Manifest at build time. When creating multiple build variants, you’ll typically want to modify some of these Manifest properties at build time. Each project has a single Manifest file containing important information about your project’s configuration. Since we want to create multiple versions of our app, we need to give each APK a unique app identifier. ![]() We need to specify a “dimension” parameter value in this instance, I’m using “mode.” These are the names of our two product flavors. This specifies a list of flavors and their settings, which in the above code are “paid” and “free.” Based on the code above, Gradle will generate four build variants: paidDebug, paidRelease, freeDebug and freeRelease. Here, we’re creating a flavor dimension consisting of “free” and “paid” versions of our app. The Android plugin creates build variants by combining flavors from different dimensions. This is where you’ll define any libraries that this module depends on. You can use the “debug” and “release” blocks to specify your application’s type-specific settings. By default, Android supports two build types: debug and release. This is a user-friendly string, which represents your application version. This is a numeric value for your application version. Ideally, you should test your application using the latest API, which means the targetSdkVersion value will always be equal to the compileSdkVersion value. This is the maximum API level that your application has been tested against. This parameter defines the lowest API level that this module supports. This is your application’s unique identifier. ![]() This contains options that will be applied to all build versions of your app, such as your debug and release builds. In Gradle 3.0.0 and higher, buildToolsVersion is optional if you don’t specify a buildToolsVersion value then Android Studio will default to the most recent version of Build Tools. This indicates the version of the compiler. You cannot use features from an API higher than this value. This is the API level that this module is compiled with. This is where you should place all of the module’s platform-specific options. The plugin is necessary to setup the Android-specific build process, so this is added automatically. This is a list of the plugins required to build this module. Let’s take a closer look at each of these sections:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |