9

We deliver release apk build from a specific flavor(QA) to our QA team.

I would like to add networkSecurityConfig only to that flavor.

In order to do that I need to add next config to the manifest.

 <application android:networkSecurityConfig="@xml/network_security_config"... > ... </application> 

Is that possible to add such config only to QA gradle flavor?

Preventing answers about <debug-overrides> it will not help me, since we delivers release build to QA.

1 Answer 1

15

Sure.

Suppose the flavor is vanilla. In app/src/vanilla/AndroidManifest.xml, have an <application> element with your android:networkSecurityConfig attribute, and nothing else. You can also have the network_security_config resource be in that flavor (app/src/vanilla/res/xml/network_security_config.xml). Then, vanilla builds will merge in that attribute; other builds will not have it.

Sign up to request clarification or add additional context in comments.

1 Comment

It solved my problem. I've forgot that you can have several AndroidManifest for different flavors.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.