dhaval
dhaval

Reputation: 2388

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.

Upvotes: 17

Views: 11286

Answers (2)

Matthew
Matthew

Reputation: 3431

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.

Upvotes: 26

Adam Ness
Adam Ness

Reputation: 6283

I have worked around this by manually changing the run configuration (Run->Edit Configurations... Under the Activity - Launch option), though that's definitely not an optimal solution.

Upvotes: 3

Related Questions