I'm having trouble understanding Build Flavors in Android Studio. I am trying to achieve a simple thing: buidling 2 signed an APK with a slight code change. The "pro" APK has only drawer.xml in res/layout/ . I read a few things in the documentation and here in StackOverflow, but I don't see anything with my build.gradle changes.
current current build.gradle file:
buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.4.+' } } apply plugin: 'android' dependencies { compile files('libs/android-support-v4.jar') compile files('libs/GoogleAdMobAdsSdk-6.4.1.jar') } android { compileSdkVersion 17 buildToolsVersion "17.0.0" defaultConfig { minSdkVersion 14 targetSdkVersion 17 } productFlavors { lite { packageName = 'com.mikebdev.refuel' } pro { packageName = 'com.mikebdev.refuelpro' } } sourceSets{ android.sourceSets.pro { res.srcDirs = ['src/main/res_pro'] } } }
I created a new folder:
/src/main/res_pro/layout/drawer.xml
What am I doing wrong here?
EDIT
I updated the build.gradle file above.
After resetting my entire Android studio due to some other instabilities, I can now select build options (lite-debug, lite-release, pro-debug, pro-release) in the lower left corner. Why even those debugs AND release options?
It now seems to work as it should.
I added the answer below
source share