Product flavors represent different versions of your app that you may release to users, such as free and paid versions of your app.
You can customize product flavors to use different code and resources, while sharing and reusing the parts that are common to all versions of your app. Product flavors are optional and you must create them manually.
Questions tagged [android-flavors]
121 questions
41
votes
3 answers
How to use different package names between flavors?
I'm trying to create a single project with 2 flavors: free and pro (versions).
My app is already in PlayStore with different packages (E.g.: com.example.appfree and com.example.app)
This is my build.gradle:
defaultConfig {
applicationId…

Felipe Porge Xavier
- 2,236
- 6
- 19
- 27
29
votes
2 answers
Gradle Warnings: Could not find google-services.json while looking in
I got the following warnings.
How can I avoid this warnings?
Could not find google-services.json while looking in
[src/flavor1/debug, src/debug, src/flavor1] Could not find
google-services.json while looking in [src/flavor1/release,
…

DrumRobot
- 393
- 1
- 3
- 15
22
votes
3 answers
Android Studio build flavors - How to have same source files in diverse flavors
I need to create a demo flavor in android studio for an app. In my app level gradle file i have created another flavor called demo and the default flavor of full of course. It looks like this:
apply plugin: 'com.android.application'
android {
…

j2emanue
- 60,549
- 65
- 286
- 456
13
votes
1 answer
ViewBinding - Different Flavor Layout Resource
I have a flavor that contains the same layout resource that is in my main source set. This is so it overrides the main one with the flavor specific one. I have done this in many places and it works fine until I introduced ViewBinding. For accuracy,…

StuStirling
- 15,601
- 23
- 93
- 150
13
votes
4 answers
BuildConfig.DEBUG vs ApplicationInfo.FLAG_DEBUGGABLE
As refer by Getting "debuggable" value of androidManifest from code?, there are two options of checking if the build is debuggable:
1.) BuildConfig.DEBUG flag
if (BuildConfig.DEBUG)`
2.) ApplicationInfo.FLAG_DEBUGGABLE
if (0 !=…

Elye
- 53,639
- 54
- 212
- 474
12
votes
1 answer
Ionic2/Cordova build publish app with different features. Example: Free and Paid
I'm developing an application, where it will have a paid (full) version and a free (lite) version.
In another application developed for Android it is possible to manage this easily with flavors (productFlavors), where I can configure the replacement…

Fernando Leal
- 9,875
- 4
- 24
- 46
10
votes
2 answers
Use different library module for each android flavor
I want to use a different library module for each flavor.
For example:
free flavor -> I need to use the free library module
paid flavor -> I need to use the paid library module
My flavors
productFlavors {
free{
.......
}
…

Ranjithkumar
- 16,071
- 12
- 120
- 159
8
votes
1 answer
Can't build release apk with multi flavors in Flutter?
I'm using Flutter (version 1.17.4) for developing Android and config multi Flavors for running multi-environment.
My source code has 3 environment: dev (devlopment), uat (QC), prod (Production).
Source:…

Huu Bao Nguyen
- 1,051
- 2
- 14
- 40
8
votes
2 answers
Flavors - No matching client found for package name
My Gradle is like bellow:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
buildscript {
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public'…
user4813855
7
votes
0 answers
Different flavours for 3 different firebase projects
I am having 3 different domains,
A,B and C.
I have created 3 different Firebase projects in their individual respective consoles.
My Question
I am planning to create a single Android project and add flavours to them to support A,B,C and also place…

oldcode
- 1,669
- 3
- 22
- 41
7
votes
2 answers
Keep flavors configs in separate .gradle files
Being short - is there a way to keep flavor configs in separate .gradle files?
And for more details - I'd like to have per flavor .gradle files (like flavorGermany.gradle, flavorUkraine.gradle, flavorItaly.gradle etc.) that will be included with…

Mykola
- 435
- 4
- 17
6
votes
0 answers
Android Product Flavors for Java Web Projects
I am wondering if someone has tried to use Android Product Flavors for simple Java Web Projects (e.g. Spring Boot) and can show me the best approach to do that?
We are using IntelliJ for web service development and it should reflect selected…

oliver
- 131
- 1
- 1
- 5
6
votes
4 answers
manifestPlaceholders value is not string
In my AndroidManifest.xml file I have the following meta-data tag which should be populated dynamically:
My gradle file looks like…

DàChún
- 4,751
- 1
- 36
- 39
6
votes
5 answers
How to hide or add menu items for Flavor?
I have an app that has 3 different flavors, full, part1 and part2.
All different flavors have different package names, so I can ship them as different apps.
Now I want that only part1 gets a menu item called Reload. The other 2 flavors shouldn't…

Terry
- 14,529
- 13
- 63
- 88
5
votes
1 answer
Disable R8 for specific flavors
I want to disable R8 for a specific flavor of my app (so setting android.enableR8=false). Does anybody know how to do it, or if it is even possible?
Can I maybe somehow have designated gradle.properties files, or how would that work?

Tim Strehlow
- 188
- 2
- 14