Questions tagged [android-build-flavors]

122 questions
25
votes
2 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.…
24
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
  • 3,805
  • 4
  • 20
  • 33
12
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
  • 636
  • 12
  • 36
12
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…
12
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,283
  • 1
  • 22
  • 42
12
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,320
  • 8
  • 35
  • 60
11
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…
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…
6
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…
6
votes
1 answer

Android Studio build variant problems

I am having difficulty getting Android Studio to build the right build variant — or even to let me select a build variant at all, sometimes. Basically I have two different versions of my project a free and a "full" version. Package ids are…
6
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
  • 2,955
  • 1
  • 18
  • 41
6
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…
5
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
  • 15,704
  • 9
  • 68
  • 97
4
votes
1 answer

Why is assetsDir missing in ProcessAndroidResources?

In my gradle build for an Android app, I have the following code to copy a bunch of images that are generated at build-time into the /assets/ directory of the APK file: android.applicationVariants.all { variant -> variant.mergeResources.doLast { …
4
votes
1 answer

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…
1
2 3
8 9