Skip to content Skip to sidebar Skip to footer

Android Studio Gradle Build Flavors

I am having troubles understanding Build Flavors in Android Studio. I am trying to achieve a simple thing: buidling 2 signed APK's with a minor code change. The 'pro' APK just has

Solution 1:

After resetting my whole Android Studio because of some other instabilities I am now able to choose in the bottom left corner my build variants (lite-debug, lite-release, pro-debug, pro-release) Why even those debug AND release variants?

I created a whole new Project with Module and copy&pasted everything from my old project which I exported from eclipse a while back in there.

NOW it works.

My Android-Studio was kinda broken before my reinstall. More crashes than there should be, some strange behaviors ans such stuff.

Solution 2:

What you're doing wrong is that you are putting your file in /src/main/res_pro/layout/drawer.xml and not setting it in the gradle. the default location for the flavor that you created would be:

/src/pro/res/layout/drawer.xml

Solution 3:

With this build script you are using build types AND flavors. For changing the xml file you only need the flavors. Try to delete buildTypes and use the productFlavor block as child of android. The changing of the res folder of the pro flavor should go into the sourceSets Block right after all the changes of the main sourceSet

Post a Comment for "Android Studio Gradle Build Flavors"