您的位置:首页 > 移动开发 > Android开发

android gradle多渠道打包不同资源

2017-05-22 09:56 337 查看

android gradle多渠道打包不同资源

若感觉不够详细,可参考:

http://xiaxveliang.blog.163.com/blog/static/2970803420160275356126/

一、build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
applicationId "xiaxl.le.com.myapplication"
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
/*签名*/
signingConfigs {
main {
storeFile file("../xxxx.keystore")
storePassword "xxxx"
keyPassword "xxxx"
keyAlias "xxxx"
}
}
buildTypes {
release {
//指定使用的签名
signingConfig signingConfigs.main
//
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
// 渠道包
productFlavors {
umeng {}
wandoujia {}
yingyongbao {}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
}


二、目录结构如下图所示:



三、wandoujia/androidmanifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="xiaxl.le.com.myapplication">
<application>
<meta-data
android:name="UMENG_CHANNEL"
android:value="WANDOUJIA" />
</application>
</manifest>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: