1

There are multiple manifests generated when we build an android project. Here is the screenshot of:

Build Directory of my application

enter image description here

Here if see, we can observe 3 directories, i.e.

  • bundle_manifest

  • instant_app_manifest

  • merged_manifests

Now I observed that when build Android App Bundle, it uses bundle_manifest. In the case of APK, it uses merged_manifests. I have a code that I am injecting in my manifest through a task in build. Gradle file. Now I can use manifestOutputDirectory to get manifest directory path(i.e. merged_manifests). But I am not able to find a similar Gradle task to locate Manifest present in bundle_manifest directory.

Can someone help me with how to get a path for bundle_manifest directory?

Muhammad Farhan
  • 1,113
  • 10
  • 22
me.ankur
  • 11
  • 2

2 Answers2

1

For example:

def manifestOutputDirectory = rootProject.getProjectDir().getAbsolutePath() +
"/${project.name}/build/intermediates/bundle_manifest/release/processReleaseManifest/bundle-manifest"

But "I have a code that I am injecting in my manifest through a task" sounds pretty strange to me.

The proper way to do it might rather be using manifest placeholders.

Martin Zeitler
  • 1
  • 19
  • 155
  • 216
  • above approach works only when we have single flavour of our app. We build multiple flavours of our app based on the region. about "injecting in my manifest through a task", I am dynamically generating deep links through gradle file because I need to support around 35-40 deeplinks, now each deeplinks should be available for multiple language(there is change in url for each language). since list grows each time we add new language, I thought to handle dynamically. now ManifestPlaceholders can be replaced with a value in manifest but it doesn't work in this scenario. – me.ankur Jan 28 '20 at 09:41
  • https://android.jlelse.eu/how-to-manage-a-complex-deeplinks-scheme-on-your-android-app-d441143cec7e above link can give you a better idea. – me.ankur Jan 28 '20 at 09:41
  • Simply define the place-holders per flavor; when removing all the line-wraps, this isn't that bad. Don't think the can be done per `resConfig`. – Martin Zeitler Jan 28 '20 at 14:14
0

Very old, but for somebody coming here for an answer, using:

bundleManifestOutputDirectory

gave me the path to the bundle_manifest directory referred to by OP

seed_87
  • 179
  • 1
  • 1
  • 11