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版本