Questions tagged [android-build-flavors]
137 questions
31
votes
3 answers
Android separate string values for release and debug builds
Every time i release my app i change all my url strings and some keys from testing to production. The way I do it is just comment out the testing strings before i release. Is there a better way to handle strings based on the build type ?

spaceMonkey
- 4,475
- 4
- 26
- 34
30
votes
3 answers
gradle: apply plugin only for specific flavor
My Android gradle currently set a flavor dimension for using different push service. (One for baidu push and one for GCM) I would like to have my Android app only to import google-services for a GCM push build flavor. Is it possible to do it?
P.S.…

chubao
- 5,871
- 6
- 39
- 64
18
votes
6 answers
React-Native productFlavors (Error type 3: Activity class does not exist)
I want to use 2 productFlavors for my Android App: live and staging.
In app/build.grandle I defined them like this:
defaultConfig {
applicationId "com.some.id"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName…

Vic Torious
- 1,757
- 3
- 21
- 24
15
votes
3 answers
Show Layouts in Android Studio depending on Flavor
I have a project in Android Studio that uses different flavors for different colors (some other things as well, but they don't matter).
What I would like is to see how a certain UI element (all defined by xml files) looks with non-default…

Invader Zim
- 796
- 2
- 14
- 39
15
votes
2 answers
how to debug product flavor in android studio?
I have two product flavors, free and pro.
The launcher activity for both is different.
But Android studio expects the launcher activity to be in AndroidManifest.xml under src/main/.
Gradle is building both flavors correctly but IDE is not able to…

dhaval
- 2,368
- 9
- 35
- 60
14
votes
3 answers
Different code in different build variant
I have two build variants in my app, one is an standard app edition and the second one is a customization app.
productFlavors {
customConfig {
minSdkVersion 14
applicationId 'es.com.custom'
…

JoCuTo
- 2,463
- 4
- 28
- 44
11
votes
4 answers
Single flavor module based on multi flavor library in Gradle
I'm working on a multi-flavor app. (gradle files below)
It uses a library called tracker that follow the same flavors internal and external
Now for the tricky part, come a new module called feature, this one has no flavor but it needs the tracker as…

Damien Locque
- 1,810
- 2
- 20
- 42
8
votes
1 answer
Cannot choose between the following variants of project :features:myDynamicFeatureModule:
I am experimenting with Android's Dynamic Feature Modules (a.k.a. on demand modules) on the side of the project I am working on.
In my PoC (proof-of-concept) project, Dynamic Feature Modules (DFM) work fine and gradle builds the project with no…

mrmitew
- 81
- 1
- 1
- 2
8
votes
1 answer
product flavor names cannot collide with build type names
I have created two build flavor one is debug and another one is release.
Step 1. Go project structure in add flavor.
step 2. Click on OK .
Now i am facing error like **
"product flavor names cannot collide with build type names"

Surya Prakash Kushawah
- 3,185
- 1
- 22
- 42
7
votes
2 answers
Flutter app build fails when trying to use flavors
I am trying to use Flavors in my app. I followed various guides and it failed to build each time with the same problem. (Since essentially every blog post and SE question quotes the same articles and resources I won't do it again)
In order to…

The Tahaan
- 6,915
- 4
- 34
- 54
7
votes
0 answers
Change Build Variant directly in Run Configuration
Considering this screen :
Today, when I want to change the build variant of my app, I click on menu #1 and switch to the one I want.
The thing I want to do, is creating multiple run configurations (click #2), for each of my useful variants. Studio…

Jidey
- 359
- 2
- 6
- 20
7
votes
3 answers
Combined BuildConfig variables in gradle flavor dimensions
In my Android application I have two flavor dimensions: "brand" (brand1, brand2) and "environment" (staging, production).
I added the "environment" dimension after a while and I had previously defined some BuildConfig variables for the different…

Carlo Moretti
- 2,213
- 2
- 27
- 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
7
votes
3 answers
Android, Gradle, product flavors and the manifest
In build.gradle, I have product flavors set up:
productFlavors
{
AlternateFlavour
{
applicationId "com.myapp.alternateflavour"
}
}
Then in the sourceSets section, I use different resource, assets and manifest directories for…

Rob Pridham
- 4,780
- 1
- 26
- 38
7
votes
4 answers
How to list all flavors in buildConfig via gradle in Android
This is a simple gradle with three flavors :
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.apipas.app.listallflavor"
minSdkVersion…

Maher Abuthraa
- 17,493
- 11
- 81
- 103