2
我的项目有一个免费和付费版本,仅对特定的味道添加依赖项 - Android Studio
免费版本使用Admob服务,但付费版本没有任何广告。 如何删除的付费版本
依赖这是我的build.gradle文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.udacity.gradle.builditbigger"
minSdkVersion 10
targetSdkVersion 22
versionCode 1
versionName "1.0"
testApplicationId"com.udacity.gradle.builditbigger.tests"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors{
free{
applicationId"com.udacity.gradle.builditbigger.flavours.free"
}
paid{
applicationId"com.udacity.gradle.builditbigger.flavours.paid"
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// Added for AdMob
compile project(':mylibrary')
compile project(path: ':endpoint-backend', configuration: 'android-endpoints')
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.google.android.gms:play-services:7.5.0'
}
我想依赖编译“com.google.android.gms:发挥服务:7.5.0”只适用于免费版本,但不适用于付费版本。
'apply'怎么样? – Kehlan