为什么要有多渠道打包?
功能相似但是为了满足不同使用者我们不想重新写一个版本,我们就会利用多渠道来打成不同的APP来满足市场需求。
什么是多渠道打包?
多渠道打包能够指定生成的app中是那种资源文件或者java字节码,这样免去了手工打包的繁琐。
android studio具体配置实现:
一、普通项目,即就是apply plugin: 'com.android.application'
这种渠道配置:资源文件和main文件夹同级位于src下面,可以是大写也可以是小写,然后在build.gradle中配置渠道信息即可
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "banwxf.com.test"
minSdkVersion 9
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt&