Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 pick the correct AndroidManifest.xml from respective product flavors like src/free or src/pro.

This is happening even after choosing the correct build variant as FreeDebug or ProDebug.

like image 505
dhaval Avatar asked Aug 24 '13 06:08

dhaval


People also ask

How do I get the current flavor in Gradle?

gradle. getStartParameter(). getTaskRequests(). toString() contains your current flavor name but the first character is capital.

What is BuildConfig flavor?

BuildConfig.FLAVOR gives you combined product flavor. So if you have only one flavor dimension: productFlavors { normal { } admin { } } Then you can just check it: if (BuildConfig. FLAVOR.

What is a build type and a product flavor in Android?

Build Type applies different build and packaging settings. An example of build types are “Debug” and “Release”. Product Flavors specify different features and device requirements, such as custom source code, resources, and minimum API levels.


1 Answers

This post has the answer you want. [What Product Flavor does Android Studio build by default in build.gradle?

You can click in the bottom left hand corner and open a box called "Build Variants" Then select the flavor (variant) you wish to work with.

like image 124
Matthew Avatar answered Sep 17 '22 15:09

Matthew