How to add more build types in app than library

后端 未结 1 1974
长情又很酷
长情又很酷 2020-12-29 10:46

Just like the example here I am extending my build types to add staging:

android {
    buildTypes {
        release {
            minifyEnabled false
                


        
相关标签:
1条回答
  • 2020-12-29 11:07

    Been here, done that :P

    You'll need to specify matchingFallback with the Android Gradle Plugin 3.0.0 for the plugin to know which fallback build type of library to use when being compiled with app code in case a certain build type defined in your app is not found in library.

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            applicationIdSuffix '.debug'
        }
        staging {
            initWith release
            applicationIdSuffix '.staging'
            matchingFallbacks = ['release']
        }
    }
    

    More info here: Migrate to Android Plugin for Gradle 3.0.0.

    0 讨论(0)
自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题