I recently imported my project from Eclipse to Android Studio and integrated Gradle’s projectFlavors to support the different environment (DEV, QA and PROD). Although I encountered a problem with my in app billing. It seems to use the package name to query the google store but depending on my productFlavors the package name changes.
my gradle.build definition
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion '19.0.1'
defaultConfig {
minSdkVersion 10
targetSdkVersion 19
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
productFlavors {
Prod {
packageName 'com.test.app'
}
Qa{
packageName 'com.test.app.qa'
versionName '1.2-QA'
}
Dev{
packageName 'com.test.app.dev'
versionName '1.2-DEV'
}
}
}
repositories{
mavenCentral()
mavenLocal()
}
dependencies {
compile 'com.test.android:infra:1.0@aar'
compile 'com.android.support:support-v4:+'
compile 'com.google.android.gms:play-services:4.3.23@aar'
compile files('libs/adgear-android-sdk.jar')
compile files('libs/crashlytics.jar')
compile files('libs/libGoogleAnalyticsServices.jar')
compile project(':libraries:facebook')
}
Thanks for your time.