Why are build types distinct from product flavors?

前端 未结 4 2002
甜味超标
甜味超标 2020-12-12 10:12

Preface: this is not a question about how to use build types and product flavors in an Android app. I understand the basic concepts involved. This question is more about

4条回答
  •  猫巷女王i
    2020-12-12 10:21

    Build Types configure the packaging of our app:

    • shrinkResources
    • proguardFile
    • etc.

    Product Flavors configure different classes and resources:

    • in Flavor1 your MainActivity can do something, while in Flavor2 it can have a different implementation
    • different app name
    • etc.

    Each product flavor can have its own values of the following properties, among others, which are based on the same properties from defaultConfig:

    • applicationId
    • minSdkVersion
    • targetSdkVersion
    • versionCode
    • versionName

提交回复
热议问题