多渠道打包的时候去掉不需要的组合

android {
    compileSdkVersion 27
    buildToolsVersion '28.0.3'

    packagingOptions {
      ......
    }

    defaultConfig {
    ......
    }

    // 多渠道 的不同配置
    productFlavors {
        ......
    }

 
    buildTypes {

        release {
            minifyEnabled true
} debug { } } variantFilter{ def names = it.flavors*.name if(names.contains("develop") && it.buildType.name=='release'){ setIgnore(true) } } lintOptions { checkReleaseBuilds false // Or, if you prefer, you can continue to check for errors in release builds, // but continue the build even when errors are found: abortOnError false } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } configurations { // all*.exclude group: 'com.android.support', module: 'support-v4' all*.exclude group: 'com.android.support', module: 'multidex' } }

这个例子就是去掉渠道是'develop'的release版本




posted @ 2018-12-19 14:45  _Gelandesprung  阅读(234)  评论(0编辑  收藏  举报