Is it possible to use multiple manifest files for different gradle assemblies / flavors?

Let's say that I have a white-labeled application that Im converts to be built into Android studio from eclipse. This application has about 10 iterations, which use basically the same code base with different resources, which use the same name, since some of the iterations have additional actions or services that are necessary in all assemblies.

I want to give up everything a lot of the old, to keep the code bases that are essentially the same, and just use the same Android studio project. I understand the base of this setting with all the source and res files, but I'm fixated on how to handle the various manifest files.

Can I use flavorings or build types to handle switching multiple manifest files?

+5
source share
1 answer

Let's say I have a white-labeled application that Im converts to be built into Android studio from eclipse.

I have a white-labeled application that Im converts to be built into android studio from eclipse.

Oh no, wait - you didn’t mean it literally ...

:-)

Can I use flavorings or build types to handle switching multiple manifest files?

That's right. You may have manifestations in sets of flavor sources and / or build type (e.g. src/debug/AndroidManifest.xml ). Their contents will be combined with the manifest in main , manifests in any projects of AARs / Android libraries and various settings in build.config to create One True Manifest for any given assembly. There is a page that describes the process of merging , and how various attributes can help it manage, although it’s nothing.

+11
source

Source: https://habr.com/ru/post/1209479/


All Articles